HTML - Div Element(s)

·

HTML Code:

<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.

HTML - Div Layouts

When HTML first began, web creators only had two choices. A table layout, or frames. The div element provides a 3rd alternative, since a div can contain any/every other type of html element within its beginning and ending tag.

HTML Code:

<div id="menu" align="right" >
<a href="">HOME</a> |
<a href="">CONTACT</a> |
<a href="">ABOUT</a>
</div>

<div id="content" align="left" bgcolor="white">
<h5>Content Articles</h5>
<p>This paragraph would be your content
paragraph with all of your readable material.</p>
</div>

HTML Div Layout:

HOME | CONTACT | ABOUT
Content Articles
This paragraph would be your content paragraph with all of your readable material.
Advanced web developers find div elements to be far easier to work with than tables, adding more content or more links to our previous example might demonstrates why a div is simpler to work with.
Let's add a "LINKS" page to our menu, and another article of content below the existing content.

HTML Code:

<div id="menu" align="right" >
<a href="">HOME</a> |
<a href="">CONTACT</a> |
<a href="">ABOUT</a> |
<a href="">LINKS</a>
</div>

<div id="content" align="left" >
<h5>Content Articles</h5>
<p>This paragraph would be your content
paragraph with all of your readable material.</p>
<h5 >Content Article Number Two</h5>
<p>Here's another content article right here.</p>

</div>

HTML Div Layout II:

HOME | CONTACT | ABOUT | LINKS
Content Articles
This paragraph would be your content paragraph with all of your readable material.
Content Article Number Two
Here's another content article right here.

Attributes HTML Basic Structure HTML Page Basic Table Tags Basic Text - Font Tags Binary Color Names HTML Color Values HTML Colors HTML Control Characters Conversion Table - Decimal Creating an HTML Page Elements HTML Entities HTML FONT COLOR in HTML FONT FACES in HTML FONT HEADERS in HTML FONT HIDING TEXT/TAGS in HTML FONT LOGICAL STYLES in HTML FONT PHYSICAL STYLES in HTML FONT SIZES in HTML Forms HTML Frames HTML Getting Started HTML head HTML Headings HTML Hexadecimal Horizontal Rule Examples HTML - Bold HTML - Code HTML - Div Element(s) HTML - Font and Basefont HTML - Italic HTML - Layout HTML - Strikethrough HTML -Getting Started HTML / XHTML Standard Event Attributes HTML 4.0 HTML Background HTML Basic HTML Basic - 4 Examples HTML codes HTML Codes - Characters and symbols HTML coding html color codes HTML Elements HTML Fonts HTML Tutorial List Item HTML Codes Form Input HTML Document Javascript Codes Color Code Organizing HTML HTML format HTML Introduction HTML Line Breaks HTML Marquees HTML Ordered HTML Preformatting HTML Reference HTML Style HTML Summary HTML syntax HTML Table Tags Examples II HTML Tag HTML Tags Chart HTML Tags You Really Should Know html tutorial HTML Tutorials HTML Unordered HTML URL Encode HTML URLs HTML valid HTML Webserver Image BORDERS in HTML Image FIXED BACKGROUND in HTML Image HEIGHT WIDTH in HTML Image HSPACE in HTML Image LINKED in HTML Image Map in HTML Images HTML Links HTML Lists HTML Marquee Basic Marquee Code Marquee Codes marquee right now Marquee Status Bar Marquee Tag Examples Marquee tag in html Marquee Tag of HTML marquee tag scrolling text Marquee Title Meta HTML Octal Paragraphs HTML Quick List HTML Scripts HTML Sound Tag Special Characters Struts HTML Tags Styles HTML Tables HTML Text Formatting HTML

What is HTML

free counters