00 Creating your first CSS page
If you want to use CSS inside the HTML page, it has to be contained in <style> tags inside the <head> tag of the HTML page as follows:
|
<html> <head> <style type="text/css"> </style> <head> <body> <h1>Hi There!!!</h1> </body> </html> |
There is nothing special here. Its a simple HTML page. but we can going to give color to the content using CSS as follows:
|
<html> <head> <style type="text/css"> h1 {color: black;} body {background-color:red;} </style> <head> <body> Hi There!!! </body> </html> |
This would give following output:
Hi There!!! |
Note, how 2 line code in css style tag has changed our output. Every CSS tag is written as a property: value pair in the following format:
SELECTOR {property: value;}
where SELECTOR is the HTML tag whose property like color, size you wish to change and value is the value of the property you wish to enforce. In the above example,tag <h1> was enforced a color black and the <body> tag was enforced a background color of red.

Recent comments
24 weeks 10 hours ago
24 weeks 4 days ago
24 weeks 4 days ago
24 weeks 6 days ago
25 weeks 4 days ago
27 weeks 5 days ago
30 weeks 5 days ago
33 weeks 4 days ago
34 weeks 2 days ago
35 weeks 23 hours ago