O'Reilly logo

The Book of JavaScript, 2nd Edition by thau!

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CSS Basics

As mentioned in the opening of the chapter, DHTML is a combination of JavaScript, HTML, and CSS. CSS enables you to position HTML precisely on your pages—no longer will you have to use bizarre tables and invisible GIFs to position elements. With a CSS you can easily place a GIF precisely in the center of your page, or position a block of text in the lower-right corner.

The <div> Tag

Before you can position any HTML, you have to use the <div> and </div> tags to tell your browser which displayed HTML you want to position. Figure 13-2 shows a simple use of <div> tags.

Basic div usage

Figure 13-2. Basic div usage

The page displayed by this code (Figure 13-3 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required