¢The <div> tag
is nothing more than a container unit that encapsulates other page elements and
divides the HTML document into sections.
¢Web developers
use <div> elements to group together HTML elements and apply CSS styles
to many elements at once.
¢For Example, by
wrapping a set of paragraph elements into a <div> element, the developer
can take advantage of CSS styles and apply a font to all paragraphs at once by
applying a font style to the <div> tag instead of coding the same style
for each paragraph element.
¢Div element
can be used to group almost any elements together. Indeed, it can contain
almost any other element
Example of DIV
<div
id="main_navigation">
.
.
.
</div>
<div id="body_content">
<h1>Page
heading</h1>
<p>Body
content</p>
</div>
.
Another Example:
<div
style="background-color:orange;text-align:center">
<p>Navigation
section</p>
</div>
<div
style="border:1px solid black;text-align:right ">
<p>Content
section</p>
</div>
0 comments:
Post a Comment