Div Element(s)

Posted by admin | Posted in HTML Tutorial | Posted on 11-08-2010-05-2008

0

The <div> tag is nothing more than a container for other tags. Much like the body tag, Div elements are block elements and work behind the scenes grouping other tags together. Use only the following attributes with your div element, anything else should be reserved for CSS. (CSS Tutorial)

·           id

·           width

·           height

·           title

·           style

For the purpose of this example, we have included the style attribute in order to color our div tag in order to bring a stronger visualization for our viewers.

Example:

<body>

<div style=”background: green”>

<h5 >SEARCH LINKS</h5>

<a target=”_blank” href=”http://www.google.com”>Google</a>

</div>

</body>

HTML Div Element:

SEARCH LINKS

Google

Above is a great visual about how a div plays the role of a container for other HTML elements, applying a background color/image is the only real way to visualize your div tags.

Write a comment

Twitter Users
Enter your personal information in the form or sign in with your Twitter account by clicking the button below.