官术网_书友最值得收藏!

The limitations of using CSS

If you've spent time working with CSS, you will know the pain and heartache suffered when working with CSS—and all in the pursuit of creating that perfect site! Those who are still somewhat new to working with CSS will, at some point, fall foul of some of the limitations of CSS, which include:

  • CSS is heavily dependent on browser capability—it is impossible to display the same content in every browser in the same way. We can get around this, but not without the expense of having to add vendor-prefixed statements. This can lead to pages with a lot of repeated code, making them slow and difficult to maintain, where even the smallest change requires a lot of effort.
  • Not every browser supports every feature within CSS—this is particularly true of CSS3. This means we need to implement some form of graceful fallback for the affected browsers if we are to maintain some form of visitor experience.
  • The advent of CSS made a functionality such as columns on a magazine website much easier, although it is still not perfect. To achieve perfect columns, we will require JavaScript or jQuery to tweak the code, which makes the page less accessible (for example, making it harder for those using screen readers). It also has an effect on the use of progressive enhancement, where content should be enhanced using a functionality, such as CSS3 or jQuery, and not reliant on it.
  • It is impossible to target specific ranges of content, without altering the markup to include placeholders; should these placeholders change, then the associated CSS must also change.
  • We can't include a rule from one CSS style in another, nor can we name a rule—the latter of which could be used by client-side scripts, even if the selector that is being referenced changes.

By now, you're probably thinking that it is all doom and gloom when using CSS; fear not, we can fix this with the help of CSS preprocessors to help make our development more effective.

主站蜘蛛池模板: 剑川县| 织金县| 巴塘县| 巨鹿县| 凤山市| 中方县| 荆州市| 奉化市| 雷州市| 上思县| 东乡县| 富蕴县| 秦皇岛市| 平乐县| 清苑县| 同江市| 霞浦县| 石楼县| 易门县| 洪泽县| 元朗区| 宜宾市| 闻喜县| 洮南市| 商洛市| 沈阳市| 赣榆县| 黄龙县| 灌云县| 久治县| 元朗区| 古丈县| 赤壁市| 灌云县| 宜城市| 无棣县| 湖南省| 忻城县| 建始县| 泸定县| 泰州市|