The <div> tag defines sections in an HTML document and is used to group block elements to apply styles. It can contain other tags and attributes like id, class, style, and title can be used to identify and style the <div> section. Common uses include wrapping content in containers with specific backgrounds, alignments, or other styles.
2. What is it?
The <div> tag defines a division or a section in
an HTML document
3. Usage
The <div> tag is used to group block-elements
to format them with styles.
examples:
id, title, style, width, class, and height
4. 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>
5. 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
6. 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)
7. Optional Attributes
-align (value: left, right, center, justify)
-Use styles instead.
Specifies the alignment of the content
inside a <div> element