• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 9. Formatting Block Elements > Using the DIV Element

Using the DIV Element

In HTML 4, the DIV element is a block element used to designate a division within a document. Otherwise, the DIV element has no formatting characteristics, although the deprecated ALIGN attribute can be used to center or right-align its content. From the start, the DIV element was intended to take any formatting characteristics from styles.

By nesting other elements within a DIV element, any styles applied to the DIV element also impact those nested elements. In the following example, a DIV rule is added to the style sheet, set to be displayed with a border, background image, and other formatting characteristics:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint