Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What kind of language is CSS?

Tags:

css

definition

People also ask

Is CSS considered a language?

Cascading-Style Sheet or CSS is not a programming language. It is a mark up language used with HTML to design the user interface of a website (the style is applied to the mark up language through out the same sections of similar parts).

What languages are HTML and CSS?

HTML and CSS are actually not technically programming languages; they're just page structure and style information. But before moving on to JavaScript and other true languages, you need to know the basics of HTML and CSS, as they are on the front end of every web page and application.


I would say it is a domain-specific declarative language.


Syntactically, CSS is a mix of two languages: the language of selectors, which is a pattern-matching one, like regexps or xpath, and the language of properties, which can be classified as "procedural-declarative", because properties are essentially assignment operators. At a subjective level, css clearly qualifies as ugly mess, like pretty much every other fruit of collective efforts on the field of language design ("a camel is a horse designed by committee").


CSS is not really a language, per se; it is more of a syntax for describing configuration directives.

In fact, it is neither of these things; CSS is a description of a number of tokens and their visual meanings; .css files contain these tokens structured in manner allowing a computer to parse them. CSS declarations can take the form of name="value" declarations in SVG documents; and the .css file structure could just as easily be employed to, say, contain unit descriptions in a particularly absurd iteration of FreeCiv.

Wikipedias definition of it as a Style sheet language seems like a bit of a forced definition of a generalization of a singularly existing phenomenon; and it should be clear that it is not in any way a markup language, as it doesn't actually, by itself, mark anything up.


CSS is most definitely a language:

Wikipedia refers to css as a 'style sheet language'

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

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

The unique features are that CSS can be used to style HTML & XML documents. XSL, on the other hand, is able to transform documents. For example, XSL can be used to transform XML data into HTML/CSS documents on the Web server. This way, the two languages complement each other and can be used together.

Both languages can be used to style XML documents.

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

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

And the next quote again from the same article:

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

                            CSS     XSL
Can be used with HTML?      yes      no 
Can be used with XML?       yes     yes
Transformation language?     no     yes
Syntax                      CSS     XML