1. Computing

Discuss in my forum

<div></div>

By

<div> Description:

The <div> element defines logical divisions within the document. This means that when you use a <div> element, you are indicating that the enclosed content is a specific section of the page. The <div> element is typically used in XHTML+CSS documents to position portions of the page.

The <div> tag is a block-level element.

<div> Web Browser Support:

<div> Attributes:

<div> End Tag:

</div> REQUIRED

Contents:

The following tags are valid within the <div> tag:
a, acronym, address, applet, b, basefont, bdo, big, blockquote, br, button, center, cite, code, dfn, dir, div, dl, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, i, iframe,

img, input isindex, kbd, label, map, menu, noframes, noscript, object, ol, p, pre, q, s, samp, script, select, small, span, strike, strong, sub, sup, table, textarea, tt, u, ul, var

<div> Valid Context:

The <div> tag is valid within the following tags:
blockquote, body, button, center, dd, div, fieldset, form, iframe, li, noframes, noscript, object, td, th

<div> Usage:

  • Style division
    <div style="color : #ff0000">red text</div>
  • Justified text
    <div align="justify">The following text will be justified across the width of the browser. This may not work reliably across all browsers, and can also be defined with style tags. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet. Lorem ipsum sit dolor amet.</div>

<div> Special Notes:

  • As this is a block-level tag, most browsers will add extra spaces before and after the element, similar to the paragraph element.
  • This element is commonly used to layout Web pages with style sheets.

More <div> Information:

  1. About.com
  2. Computing
  3. Web Design / HTML

©2014 About.com. All rights reserved.