Home / CSS - Cascading Style Sheets

CSS - Cascading Style Sheets

Style language for the web. You see all those beautiful web sites. Well it wouldn’t all be possible with just HTML. CSS enables developers to separate content from presentation. That way we can have all those different layouts, colours, columns and fonts. The same content can be presented in many different ways using CSS.

At first browsers, especially Internet Explorer from Microsoft had many difficulties and issues with interpreting css code but that was in 1996. Today most of available browsers support css in full.

CSS Syntax

CSS syntax is quite easy. Mostly declaration blocks are used in separate .css file. Each declaration block contains declarations within two braces.

Examples :

div { background-color:#fff; color: #000; font-size: 14px }

In the example we declared white background, black text and 14px font size for our div.

div { background-image:url(‘background-image.jpg’); }

In this case we set up the background image for our div. It will repeat itself and if don’t want that we just add no-repeat at the end before semicolon.