Web Design

CSS Introduction

css_intro


{youku}id_XMjU5MjkwMzUy.html{/youku}

HTML uses tags to describe content.

<html>
<body>
<h1>This is my headline </h1>
<h2>This is a sub-heading </h2>
<p> This is my paragraph</p>
</body>
</html>

CSS is used to describe content for the tags.

h1 {color:blue;font:arial;text-align:center;}

An easier way to read this code is to write it like this:

h1
{
color:blue;
font:arial;
text-align:center;
}

You can also create a "class" of text. Below I created a class called "code".

In the middle of this sentence, the colour will be different

<p>In the middle of this <span class="code">sentence, the</span> colour will be red</p>

This was written in my CSS document like this:

.class
{
color:red;
}

Try to keep your CSS in one document, and attach it to your web page. Text > CSS Styles > Attach Style Sheet...

For more detail on CSS, go to http://www.w3schools.com