- Learning Less.js
- Alex Libby
- 346字
- 2021-09-03 09:38:04
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.
推薦閱讀
- Creating Dynamic UI with Android Fragments
- INSTANT Wijmo Widgets How-to
- 深入淺出SSD:固態存儲核心技術、原理與實戰(第2版)
- 筆記本電腦維修不是事兒(第2版)
- 微軟互聯網信息服務(IIS)最佳實踐 (微軟技術開發者叢書)
- 電腦高級維修及故障排除實戰
- 面向對象分析與設計(第3版)(修訂版)
- Blender Quick Start Guide
- Blender Game Engine:Beginner's Guide
- 新編電腦組裝與硬件維修從入門到精通
- 基于網絡化教學的項目化單片機應用技術
- Blender for Video Production Quick Start Guide
- Learn Qt 5
- 超炫的35個Arduino制作項目
- Spring微服務實戰(第2版)