CSS Primer

## Web Primer

Web Primer Web HTML Web CSS Web JavaScript Web XML Web Server Web SQL

# CSS Primer

« Previous
Next Chapter »

## CSS - Cascading Style Sheets

CSS defines HOW HTML elements are to be displayed.

CSS describes the visual style (appearance, layout, color, fonts) of HTML elements.

CSS was designed to separate document layout from document content (which greatly improved HTML flexibility and reduced HTML complexity).

CSS is easy to learn. You can use HTML element names as selectors, and list the style properties inside curly brackets:

## CSS Example

body
{
background-color:#d0e4fe;
}
h1
{
color:orange;
text-align:center;
}
p
{
font-family:"Times New Roman";
font-size:20px;
}
Try it yourself »

Click on the "Try it yourself" button to see how it works

CSS saves a lot of work!

The CSS definitions are normally stored in external files. This enables a web developer to change the appearance and layout of every page in a web site, just by editing one single file!

If you have ever tried to change the style of all elements in all your HTML pages, you understand how you can save a lot of work by storing the style definitions in an external file.

Another CSS Demonstration

## How to Learn CSS?

Study our Complete CSS Tutorial

Study our Complete CSS Reference

« Previous
Next Chapter »

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE