CSS let web pages change their whole look by editing one file
Early web pages carried their fonts, colours and borders inside the markup, repeated wherever they appeared. Want every heading blue instead of red? You hunted down each one. Cascading Style Sheets moved all that styling into a separate file, so one change could restyle an entire site.
CSS is the language that controls how documents written in markup such as HTML, XML or SVG are presented, and alongside HTML and JavaScript it is one of the web's core technologies. Its central idea is separating content from presentation. Authors describe the structure, marking what is a heading or a sub-heading, and leave choices of font, size, colour and spacing to the style sheet. Pages that share one external file stay simpler, and the browser can cache that file so later pages load faster.
The same page can then look different depending on how it is consumed: on a screen, on paper, read aloud by a screen reader or rendered on a Braille device, with separate rules for mobile displays. CSS even covers non-visual qualities such as reading speed and emphasis for speech. The World Wide Web Consortium maintains the specifications and has now deprecated presentational markup in HTML altogether. The text/css media type was registered in March 1998.
A style sheet is a list of rules, each pairing selectors with a block of declarations. Selectors pick out parts of a page: every element of a type, an element with a unique id, any element tagged with a class, or elements by their position in the document tree. Pseudo-classes such as hover react to things outside the document, like the mouse pointer resting on a link. Order matters, so a class inside a div targets something different from a div inside a class. Each declaration pairs a property with a value, which might be a keyword, a pixel count, a share of the screen width or a colour in RGB or HSL terms.
The name cascading refers to the predictable priority scheme that decides which declaration wins when several apply to the same element. Beyond browsers, CSS also styles the GTK widget toolkit.
Source: CSS