What language is CSS?

What language is CSS?

My first inclination was to call it markup language ... but this is not very suitable for the form:

Markup language is a system for annotating text in a way that is syntactically distinguishable from that text. - wikipedia

CSS uses various selectors to apply properties to elements inside HTML, markup language

+44
css definition
Apr 19 '10 at 21:21
source share
4 answers

I would say that this is a domain declarative language.

+30
Apr 19 '10 at 21:27
source share

CSS is not really a language in itself; it is rather a syntax for describing configuration directives.

This is actually none of these things; CSS is a description of a number of tokens and their visual meanings; .css files contain these tokens, structured so that the computer can parse them. CSS declarations can take the form of name = "value" declarations in SVG documents; and the .css file structure can also be easily used, for example, to describe units in the particularly absurd iteration of FreeCiv.

The definition of Wikipedia as a style language of styles seems a little compelled to define a generalization of a singularly existing phenomenon; and it should be clear that it is in no way a markup language, since it itself does not mark anything.

+5
Apr 19 '10 at 21:32
source share

Syntactically, CSS is a combination of two languages: a selector language that is comparable to a pattern, such as a regular expression or xpath, and a property language that can be classified as “procedural-declarative” because properties are assignment operators. On a subjective level, css clearly qualifies as an ugly mess, like almost all the other fruits of a collective effort in language design ("camel is a horse designed by a committee").

+5
Apr 19 '10 at 21:48
source share

CSS is definitely a language:

Wikipedia refers to css as a “style language”

http://en.wikipedia.org/wiki/Style_sheet_language

Also from the W3C who developed CSS: (comparing xsl and css )

Unique features: CSS can be used to create HTML and XML documents. XSL, on the other hand, is capable of converting documents. For example, XSL can be used to convert XML data to HTML / CSS documents on a web server. Thus, these two languages ​​complement each other and can be used together.

Both languages can be used for XML document styles.

As you can see from the second sentence, the W3C refers to CSS as a language.

http://www.w3.org/Style/

And the following quote is again from the same article:

The fact that W3C developed XSL in addition to CSS has caused some confusion. Why create a second style language when developers haven't even finished the first? The answer can be found in the following table:

CSS XSL Can be used with HTML? yes no Can be used with XML? yes yes Transformation language? no yes Syntax CSS XML 
+2
Apr 19 '10 at 21:26
source share



All Articles