CSS or Cascading Style Sheets was introduced in 1997 to create a template for how a Web page design would look. With time CSS has grown in popularity and it is now considered as essential a skill for web developers as knowing HTML.
Style Sheets are the technical details of a document ensuring that the document is viewed according to the web developer’s design. Hence when a search engine finds a web page, the style sheet tells the search engine how the web page should look to the end user.
Cascade likens the sheets to a waterfall where the water passes through all the rocks in a river but only the ones at the riverbed are the determinants of the direction of the flow of the water.
Similarly, web pages are a series of style sheets but there will always be one overarching style sheet that determines the final look of the page. This style will override your browsers default settings to show you the final web page in the way the designer intends you to see it.
The Significance of CSS
CSS is one of the most useful skills in a web developers arsenal because it defines the overall impact of a webpage. It is also easy to tweak in case changes are required, and the designer will not need to change the base XHTML.
However CSS is more complicated to acquire as a skill than HTML.
Prior to the introduction of CSS, the formatting rules of the webpage were embedded within the HTML markup. All elements have to be openly and repeatedly defined in HTML whereas CSS allowed all the design elements to be separated making the HTML much simpler, while CSS allowed for easy modification in the future.
Elements of CSS
A style sheet is made up of a set of rules which includes selectors and a declaration block. Selectors match which part of the sheet a particular style applies to through tags and attributes. Declaration blocks are a set of declarations enclosed in braces and consisting of a property, a colon and a value.