Role Of Div Tag In HTML5 - C# Corner
Có thể bạn quan tâm
Role of Div Tag in HTML5
Code: Htmlpage.htm
- Valon Ademi
- Oct 25, 2019
- 92.3k
- 0
- 1
-
- Other Artcile
Introduction
The <div> tag is used for defining a section or a division in an HTML page. You can use it to group large sections as a block and can be formatted (Presentation of block) using Style Sheet (CSS) in your document. For example, you can wrap a header block in one div and content block in another div. See the following code, in which I used a different div for each block. In simple terms, it is a container in which you create a division of your documents and you can manipulate your document layout using class and id names in the div tag. HTML5 has introduced a number of new tags that you will use in place of div tags such as article, aside, footer, header, section, and nav. Syntax <divalign=" Specifies the alignment of the content inside a div element. Possible values are : center | justify | left | right" class="Specifies class names" dir=" rtl (Right to Left | ltr (Left to Right)" id=" specifies unique id identifier" lang=" Specifies a language code for the content in an element. " style="style information" title="advisory text"></div>
Attributes Introduced by HTML5 | |
accesskey | spaced list of accelerator key(s) |
contenteditable | true | false | inherit |
contextmenu | id of menu |
data-X | user-defined data |
draggable | true | false | auto |
hidden | hidden |
itemid | microdata id in URL format |
itemprop | microdata value |
itemref | space-separated list of IDs that may contain microdata |
itemscope | itemscope |
itemtype | microdata type in URL format |
spellcheck | true | false |
tabindex | number |
HTML5 Event Attribute | |||
onabort | onblur | oncanplay | oncanplaythrough |
onchange | onclick | oncontextmenu | ondblclick |
ondrag | ondragend | ondragenter | ondragleave |
ondragover | ondragstart | ondrop | ondurationchange |
onemptied | onended | onerror | onfocus |
onformchange | onforminput | oninput | oninvalid |
onkeydown | onkeypress | onkeyup | onload |
onloadeddata | onloadedmetadata | onloadstart | onmousedown |
onmousemove | onmouseout | onmouseover | onmouseup |
onmousewheel | onpause | onplay | onplay |
onplaying | onprogress | onratechange | onreadystatechange |
onscroll | onseeked | onseeking | onselect |
onshow | onstalled | onsubmit | onsuspend |
ontimeupdate | onvolumechange | onwaiting |
- <!DOCTYPE html>
- <html>
- <head>
- <linkhref="StyleSheet.css"rel="stylesheet"type="text/css"/>
- <title></title>
- </head>
- <body>
- <divclass="MainBody">
- <divclass="header">
- <h3>This is header </h3>
- </div>
- <divclass="left">
- <h4>Left</h4>
- <h5>Content</h5>
- </div>
- <divclass="center">
- <h1>Center Content</h1>
- </div>
- <divclass="right">
- <h2>Right Content</h2>
- </div>
- <divclass="footer">
- <h3>Footer</h3>
- </div>
- </div>
- </body>
- </html>
- body {
- margin: 0px;
- padding: 0px;
- width: 100%;
- color: #959595;
- font: normal12px/1.8emArial, Helvetica, sans-serif;
- background: silver;
- }
- .MainBody {
- width: 770px;
- margin: 0auto;
- padding: 0px;
- }
- .header {
- background-color: Green;
- height: 50px;
- text-align: center;
- font-size: 20px;
- color: White;
- margin: 0px;
- padding: 0px;
- width: auto;
- }
- .header h3 {
- font-size: 30px;
- line-height: 40px;
- }
- .left {
- width: 150px;
- height: 500px;
- margin: 0px;
- padding: 0px;
- background-color: Fuchsia;
- float: left;
- text-align: center;
- }
- .left h4 {
- font-size: 20px;
- color: Navy;
- margin-top: 200px;
- }
- .left h5 {
- font-size: 20px;
- color: Navy;
- }
- .center {
- width: 420px;
- background-color: Red;
- margin-top: -16.1px;
- margin-left: 150px;
- padding: 0px;
- height: 500px;
- }
- .center h1 {
- color: Navy;
- text-align: center;
- padding: 250 00 0;
- vertical-align: bottom;
- line-height: 500px;
- }
- .right {
- width: 200px;
- height: 500px;
- background-color: Lime;
- float: right;
- margin-top: -500px;
- margin-left: 0px;
- padding: 0px;
- color: Navy;
- text-align: center;
- line-height: 475px;
- }
- .footer {
- background: yellow;
- background-color: Green;
- height: 50px;
- text-align: center;
- padding-left: 0px;
- font-size: 20px;
- color: White;
- margin: -30px0px0px0px;
- width: auto;
- }
- .footer h3 {
- font-size: 30px;
- line-height: 40px;
- }
- CSS
- div tag
- div tag in HTML 5
- HTML5
- javaScript
- Learn HTML5
- Style Sheet
Frontend Developer Interview Questions and Answers
Download Now! Similar ArticlesTừ 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 »HTML Div Tag - Tutorial Republic
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