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
6 days 21 hours ago
2 weeks 4 days ago
4 weeks 5 hours ago
4 weeks 2 days ago
4 weeks 4 days ago
4 weeks 5 days ago
29 weeks 1 day ago
29 weeks 4 days ago
29 weeks 5 days ago
30 weeks 14 hours ago