The basics

Follow this guide to learn the basics of CSS. You will learn what a selector, property, value, ID and class is.

What is CSS?

Everything you write goes into a style-sheet. <style> </style>

selector { property:value; }

Selector is the html value you want to style.

A Deceleration is made up of a property and value.

Property declares what aspect of the selector should be styled. That is the property title and value is the style to that property.

Example:

body[ background:#000000; font-family: "Times new roman"; }

#broken{ text-align:left; color:#FFFFFF; }

Above is an id selector.

It's used to style a single element. It can not be used again.

.trouble{ text-align:center; color:#000000; }

As shown above a class is used to style a group of elements. It can be used again and again.

As you can see, ids and classes can be named anything you want. Keep in mind though they can't start with a number.

This is how you would put in your broken id selector after your style-sheet.

<div id="broken"> See how this works. Everything in broken is included in here. </div>

Where the trouble class would be like this example.

<div class="trouble"> Everything is included in here. </div>

You now know the basics of CSS!