DHTML LESSON 1
Make a header with some text in it:
<H2>Header 1</H2>
You should have this:
Header
Now if you wanted to make the header green, you would do this:
<H2><FONT color="green">Header 1</FONT></H2>
You'd get something like this:
Header 1
Now suppose you wanted to make every header on your page green.
Do you have to use the
font tag every time? Thanks to DHTML or CSS(for now), the answer is no.
Remove the font tags from your page and your notepad should look something like this:
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<H2>Header 1</H2>
</BODY>
</HTML>
Add style tags to your webpage:
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE TYPE="text/css">
</STYLE>
</HEAD>
<BODY>
<H2>Header 1</H2>
</BODY>
</HTML>
Now add the element H2 in the style tags and a pair of curly brackets.
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE TYPE="text/css">
H2 {}
</STYLE>
</HEAD>
<BODY>
<H2>Header 1</H2>
</BODY>
</HTML>
Now make every H2 element on the page green.
<HTML>
<HEAD>
<TITLE></TITLE>
<STYLE TYPE="text/css">
H2 {color:green}
</STYLE>
</HEAD>
<BODY>
<H2>Header 1</H2>
</BODY>
</HTML>
That's there is to it. Go to the next chapter to learn more about CSS properties
and the class element. If you get this chapter, the next chapter is a piece of cake.
|