Building My First WebSite - CSS Tutorial




Before Creating a WebSite with CSS you should have some knowledge of HMTL.

So if you haven't read my tutorial about HTML, you can click on Building a WebSite with HTML now.


1. What does CSS mean?

CSS stands for Cascading Style Sheets.

2. What does CSS do?

CSS defines how to display HTML elements, adds style to this elements.

3. How do we write CSS code?

To write a line of CSS code you need three things: a HTML element, a property and a value for that property.

Here is an example: h1 { color:red; }.  => Some H1 text.


4. How to include CSS in our WebSite?

There are two ways to include styles in your WebSite. The first method is to save your styles in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a WebSite, just by editing one single file! Or you can write your CSS code directly into the HTML page.


Here are some example of Ways To Include CSS in a HTML page.

This code must be placed between the  tag.

Link to external file.



There are two ways to add style to HTML elements if we use external css file. You can use the attribute class or id.

1. ID atribute is used to specify a style for a single, unique element. We define it with a "#".

2. CLASS atribute allows you to set a particular style for any HTML elements with the same class. We define it with a ".".


Write code direct in page.


Inline style. Add style directly to specific HTML element.




As you can see, on the first line is the attribute "style" which value is the CSS code, the CSS property (font-size) and its value (16pt), the HTML element here being the tag.

Now we know what CSS means, how to write a CSS code line and how to add CSS to your website, so click on Building a WebSite with CSS to move forward.





Responses

0 Respones to "Building My First WebSite - CSS Tutorial"

Post a Comment

 

Link Liên kết

Thông tin liên hệ

YH: huonggiangdhtn
Skype: tthuonggiang
Return to top of page Copyright © 2010 | joomla extensions jw-extension.net