Cascading style sheets(CSS) are used to format the layout of Web pages. CSS is a form of HTML mark-up that provides web designers with greater control over typography and spacing between elements on a page.
CSS gives more control over the appearance of a Web page to the page creator than to the browser designer or the viewer.
CSS provides you as a designer with precise control over the fonts used on your site, including size, letter spacing and text decoration.
CSS is great for creating text styles, it is helpful for formatting other aspects of Web page layout as well.
For example, CSS can be used to define the cell padding of table cells, the style, thickness, and color of a table's border, and the padding around images or other objects.
CSS gives Web developers more exact control over how Web pages will look than HTML does. This is why most Web pages today incorporate cascading style sheets.
HTML is used to structure content. CSS is used for formatting structured content.
Okay, it sounds a bit technical and confusing. But please continue reading. It will all make sense to you soon.
Back in the good old days when Madonna was a virgin and a guy called Tim Berners Lee invented the World Wide Web, the language HTML was only used to add structure to text. An author could mark his text by stating "this is a headline" or "this is a paragraph" using HTML tags such as
As the Web gained popularity, designers started looking for possibilities to add layout to online documents. To meet this demand, the browser producers (at that time Netscape and Microsoft) invented new HTML tags such as for example which differed from the original HTML tags by defining layout - and not structure.
This also led to a situation where original structure tags such as
| were increasingly being misused to layout pages instead of adding structure to text. Many new layout tags such as were only supported by one type of browser. "You need browser X to view this page" became a common disclaimer on web sites.|
CSS was invented to remedy this situation by providing web designers with sophisticated layout opportunities supported by all browsers. At the same time, separation of the presentation style of documents from the content of documents, makes site maintenance a lot easier.
CSS was a revolution in the world of web design. The concrete benefits of CSS include:
control layout of many documents from one single style sheet;
more precise control of layout;
apply different layout to different media-types (screen, print, etc.);
numerous advanced and sophisticated techniques.