Limitations
Some noted limitations of the current capabilities of CSS include:
- Selectors are unable to ascend
- CSS offers no way to select a parent or ancestor of an element that satisfies certain criteria, until CSS Selectors Level 4, which is still in Working Draft status. A more advanced selector scheme (such as XPath) would enable more sophisticated style sheets. However, the major reasons for the CSS Working Group previously rejecting proposals for parent selectors are related to browser performance and incremental rendering issues.
- Vertical control limitations
- While horizontal placement of elements is generally easy to control, vertical placement is frequently unintuitive, convoluted, or outright impossible. Simple tasks, such as centering an element vertically or getting a footer to be placed no higher than bottom of viewport, either require complicated and unintuitive style rules, or simple but widely unsupported rules.
- Absence of expressions
- There is currently no ability to specify property values as simple expressions (such as
margin-left: 10% – 3em + 4px;
). This would be useful in a variety of cases, such as calculating the size of columns subject to a constraint on the sum of all columns. However, a working draft with a calc value to address this limitation has been published by the CSS WG. Internet Explorer versions 5 to 7 support a proprietary expression statement, with similar functionality. This proprietary expression statement is no longer supported from Internet Explorer 8 onwards, except in compatibility modes. This decision was taken for "standards compliance, browser performance, and security reasons". - Lack of column declaration
- While possible in current CSS 3 (using the
column-count
module), layouts with multiple columns can be complex to implement in CSS 2.1. With CSS 2.1, the process is often done using floating elements, which are often rendered differently by different browsers, different computer screen shapes, and different screen ratios set on standard monitors. - Cannot explicitly declare new scope independently of position
- Scoping rules for properties such as z-index look for the closest parent element with a position:absolute or position:relative attribute. This odd coupling has undesired effects. For example, it is impossible to avoid declaring a new scope when one is forced to adjust an element's position, preventing one from using the desired scope of a parent element.
- Pseudo-class dynamic behavior not controllable
- CSS implements pseudo-classes that allow a degree of user feedback by conditional application of alternate styles. One CSS pseudo-class, ":hover", is dynamic (equivalent of JavaScript "onmouseover") and has potential for abuse (e.g., implementing cursor-proximity popups), but CSS has no ability for a client to disable it (no "disable"-like property) or limit its effects (no "nochange"-like values for each property).
- Cannot name rules
- There is no way to name a CSS rule, which would allow (for example) client-side scripts to refer to the rule even if its selector changes.
- Cannot include styles from a rule into another rule
- CSS styles often must be duplicated in several rules to achieve a desired effect, causing additional maintenance and requiring more thorough testing.
- Cannot target specific text without altering markup
- Besides the
:first-letter
pseudo-element, one cannot target specific ranges of text without needing to utilize place-holder elements.
Read more about this topic: Cascading Style Sheets
Famous quotes containing the word limitations:
“Growing up means letting go of the dearest megalomaniacal dreams of our childhood. Growing up means knowing they cant be fulfilled. Growing up means gaining the wisdom and skills to get what we want within the limitations imposed by realitya reality which consists of diminished powers, restricted freedoms and, with the people we love, imperfect connections.”
—Judith Viorst (20th century)
“Much of what contrives to create critical moments in parenting stems from a fundamental misunderstanding as to what the child is capable of at any given age. If a parent misjudges a childs limitations as well as his own abilities, the potential exists for unreasonable expectations, frustration, disappointment and an unrealistic belief that what the child really needs is to be punished.”
—Lawrence Balter (20th century)
“The limitations of pleasure cannot be overcome by more pleasure.”
—Mason Cooley (b. 1927)