www.ntnu.no *
INFOWEB >  developement and programming >  web development  > CSS - Cascading Style Sheets
Tasks
You may add comments
Or e-mail this article
Read articles written by livermor
User rating
How much did this article help you?
Much Some Little
Print preview
You do not need a 'printer-friendly page' to print this page. Here's why
Contents

CSS - Cascading Style Sheets

What is CSS?

CSS[1] is a technology used for controlling the layout of documents written in HTML. This way, no formatting information is available in the HTML[2] -document, which instead refers to the stylesheet.

Why use CSS?

When you first hear about design of web pages, people talk about HTML. But HTML is not really that good when it comes to designing and controlling the formatting of a web page. CSS opens for better and easier formatting and effects that are not available with HTML.

A lot of people use tables to control the design of web pages. It allows the creator to decide where different objects should appear and some effects. Unfortunately, tables need a lot of resources to load and are not really that pretty. In addition to this, when creating very big pages or a group of pages, tables are a lot of work.

CSS is not a part of the HTML-document, but something outside these. This means that one CSS stylesheet may 'control' several HTML-documents. Which in turn means less work. In addition to this, there will be less for the web browser to load as the HTML will only include HTML-tags and text.

Also, you can define different CSS stylesheet in relation to what kind of medium or web browser the viewer is using. If it is a PDA, laptop, printing, cell phone. Also if it is a web browser for blind people and such.

How to use CSS

The best way to learn CSS is to experiment. Write a document with a couple different parts and start playing around with CSS stylesheets to see what happens to the document with smaller or bigger changes. The web is also a great resource for tutorials on how to use CSS with a lot of expamples, most of them in English. Here are some:

Problems using CSS

The greatest problem using CSS is how different web browsers handle the stylesheet. Some features that look great in the web browser you are using for testing may not work in other web browser. It is therefore important to test the pages in several web pages, in particular Internet Explorer, Opera and Mozilla Firefox as these are the web browsers most people use.

Lenker

Footnotes

[1]: CSS: Cascading Style Sheets

[2]: HTML: HyperText Markup Language


Languages: en flag_no Comments: 0 Aid: 519 User rating:
 
 
Last updated: 2007-07-29 Author: livermor Read: 201 times