< div >



Definition

The < div > tag is an HTML tag that defines a division or section of a document.

http://www.w3schools.com/tags/tag_div.asp

Note
- Browsers generally place a line break before and after the div element.
-This tag requires and closing tag.
-This element is a block element.

Tips - Use the < div > tag to group block-elements to format them with styles.

Standard Attributes

id, class, title, style, dir, lang, xml:lang

Optional Attributes

DTD indicates in which DTD the attribute is allowed. Strict, Transitional, or Frameset


AttributesValue
Description
DTD
Alignleft
right
center
justify
How to align the text in the div element.Transital
and
Frameset

Example

Here is an example of the div tag being used to space two lines of text.



This text represents a section.


This text represents a second section.



Here is an example of the title and the content of a document seperated using the < div > tag.


Title


example text example text example text.
example text example text example text.


Another example


Input:
<div align="right">Hello.</div>

Output:
Hello.

-Nicole M.


Page Information

  • 11 months ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts