HTML Div Tag - Tutorial Republic
Có thể bạn quan tâm
Topic: HTML5 Tags ReferencePrev|Next
Description
The <div> (short for division) tag is generic container for flow content, which has no default rendering or meaning. The <div> tag is extensively used to define the structural sections of a document and to layout a web page using CSS.
The following table summarizes the usages context and the version history of this tag.
Placement: | Block |
---|---|
Content: | Block, inline, and text |
Start/End Tag: | Start tag: required, End tag: required |
Version: | HTML 3.2, 4, 4.01, 5 |
Tip: The <div> element is ideal for grouping elements for associating the styles and scripts (using the class or id attributes), since it doesn't convey any meaning about its contents and also doesn't have any default styling or meaning.
Syntax
The basic syntax of the <div> tag is given with:
HTML / XHTML: <div> ... </div>The example below shows the <div> tag in action.
Example
Try this code » <div class="welcome-box"> <h1>Welcome</h1> <p>Hi, welcome to our website.</p> </div>Tag-Specific Attributes
The following table shows the attributes that are specific to the <div> tag.
Attribute | Value | Description |
---|---|---|
align | leftrightcenterjustify | Obsolete Aligns the content inside a div element. |
Global Attributes
Like all other HTML tags, the <div> tag supports the global attributes in HTML5.
Event Attributes
The <div> tag also supports the event attributes in HTML5.
Browser Compatibility
The <div> tag is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: HTML Layout, CSS Alignment.
Related tag: <span>.
Previous Page Next PageTừ khóa » Html5 Tag Div
-
HTML Div Tag - W3Schools
-
: The Content Division Element - HTML - MDN Web Docs
HTML 5
TagHTML Div – What Is A Div Tag And How To Style It With CSS
HTML | Div Tag - GeeksforGeeks
HTML Div Tag - Usage, Attributes, Examples - W3docs
How To Use The DIV Tag In HTML - Instructions - TeachUcomp, Inc.
HTML - Div Tag - Tutorialspoint
HTML Tag »Role Of Div Tag In HTML5 - C# Corner
HTML Tutorial For Beginners 13 - The Div Tag - YouTube
7 Alternatives To The
HTML Tag | By Zac Heisey - MediumHTML Tag: Div | HTML Dog
HTML And CSS Tutorial - Nanyang Technological University
Copyright © 2022 | Thiết Kế Truyền Hình Cáp Sông Thu