DHTML Lesson 1 - The Basics
DHTML, or Dynamic HTML, is technically not a scripting language. It is a way to activate features in your web site viewer’s browser. While it is possible to create cross browser compatible DHTML, you may notice that the way Netscape 4.0 and later and Internet Explorer 4.0 and later handle this language very differently.
We will begin with a brief lesson on how to add DHTML to your website for Netscape 4.0 and then will cover the same task in Internet Explorer 4.0 in a later lesson. Future tutorials will discuss creating cross browser compatible DHTML.
First, to start with Netscape 4.0, you will need just one tag. The

This is very similar to HTML and should not be difficult to catch on to this new language very quickly. You can also begin to add elements to this tag, to change font color or other attributes.
For example:

If you are going to have more than one layer on a page, you will need to give that layer a specific ID, as we have done above by naming it “first layer.†Your following tags will give this layer the attributes that you need to create a colored background and text.
You may have noticed that when you add a layer to an existing HTML page, this layer “floats†on the top of the page, and is not connected with the rest of the text. This is what makes DHTML so much fun and gives you the ability to dynamically design and position elements on your page.
You may noticed as well that you do not need to use the common HTML code for colors, such as # FFFFFF. Instead, you can simply enter in “whiteâ€.
Now that you know how to add dynamic attributes, you will need to learn proper syntax so that your content will display correctly. If you do not use proper syntax, all of your efforts will be for naught.
Our next lesson will cover proper syntax to use while creating dynamic content for Netscape 4.0 as well as a way to create a changing background that will display different colors over a set period of time. This can be used to create interesting effects for your site and add visual interest.
Related Posts:Posted on 12/27/05 1:31 AM
Be the first to comment!