SlideShare a Scribd company logo
<div> Tag
HTML Tag
What is it?
The <div> tag defines a division or a section in
an HTML document
Usage
The <div> tag is used to group block-elements
to format them with styles.

examples:
id, title, style, width, class, and height
Examples of <div>
Container of other tags, grouping other tags
together

<body>
<div style="background: green">
<h5 >SEARCH LINKS</h5>
<a target="_blank" href="http://www.google.com"
>Google</a>
</div>
</body>
Attributes (Standard)
- standard, and can be used in nearly all
HTML/XHTML tags.
- <base>, <head>, <html>, <meta>,
<param>, <script>, <style>, and
<title>.
- class, id, style, and title
Attributes (Event)
- event attributes that can be inserted
into HTML / XHTML elements to define
event actions.
- onload (script to be run when a document
loads) or onunload (script to be run when a
document unload)
Optional Attributes
-align (value: left, right, center, justify)
-Use styles instead.
Specifies the alignment of the content
inside a <div> element
Code Snippet
 <div style="background-color:orange;text-align:center">
 <p>Bright Widget</p>
 </div>
 <div style="background-color:olive;text-align:center">
 <p>Dull widget</p>
 </div>

 Results:
 Bright Widget (1st one)
 Dull Widget (2nd one)
Screenshot
URLs
http://rlv.zcache.com/success_in_life_is_just_a_div_tag_away_humor_flyer-
p244786923606908311b2pv5_400.jpg

http://www.w3schools.com/tags/tag_div.asp

http://www.quackit.com/html_5/tags/html_div_tag.cfm

More Related Content

Div tag presentation