asp.net.ph

Skip Navigation Links

DIV Element | DIV Object

Language References


Specifies a container for grouping HTML elements.HTML 3.2, 4, 4.01, 5

HTML Syntax

Remarks

The DIV element encloses a block of content. A DIV is useful for applying alignment and style characteristics to a section of a document that contains multiple elements, rather than having to apply the alignment and styles to each element in the block. Each DIV element starts on a new line.

To enclose an inline section of content, authors can use the SPAN element.

Members

DIV Members

Example

The following example uses a DIV element to apply styles to a group of content. Although the example uses only a single statement of text, a DIV can contain any combination of elements, including images and embedded objects.

<div style="font:bold 14pt arial; background:steelblue; color:beige;
   width:75%; padding:30; text-align:center; border:medium ridge">
      This area represents a DIV, or a defined section in the document.
      Its text is centered, has a background and border, and a defined width.
</div>

This area represents a DIV, or a defined section in the document. Its text is centered, has a background and border, and a defined width.

Note that some versions of older browsers may render the style attributes somewhat differently.

See Also

SPAN



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note