Div tag in HTML

Definition and usage

Card

used to define a section or a region in HTML text.

Card

Group content components into one block to format using CSS or to perform certain tasks with JavaScript.

Browser support

Div tag in HTML Picture 1

Div tag in HTML Picture 2 Div tag in HTML Picture 3 Div tag in HTML Picture 4 Div tag in HTML Picture 5

There is no difference of this tag between HTML 4.01 and HTML5.

TIP : Element

Often used together with CSS to organize web layouts.

Note : By default, browsers always put line breaks before and after the element

. However, this can be changed with CSS.

Structure

 

For example





Here are some documents.




This is a title in a div tag


This is some text in a div tag.




Here are some documents.




Show browser:

Div tag in HTML Picture 6

4.5 ★ | 2 Vote

May be interested

  • Tag aside in HTMLPhoto of Tag aside in HTML
    tags define content outside the main content.
  • CSS color coding, standard color code in website designPhoto of CSS color coding, standard color code in website design
    owning standard css color coding, you will be more confident when designing, web programming, because color is an indispensable part in the internet world. in this article, tipsmake.com would like to introduce you to the most beautiful and popular color codes, along with hex codes for your convenience.
  • Block and inline elements in HTMLPhoto of Block and inline elements in HTML
    each element in html has a default display value, depending on which element it is.
  • Class properties in HTMLPhoto of Class properties in HTML
    in html, class properties are used to identify one or more class names for html elements.
  • The id attribute in HTMLPhoto of The id attribute in HTML
    in html, the id attribute is used to specify a unique id for an html element (the value must be unique in the html file).
  • Iframe in HTMLPhoto of Iframe in HTML
    in html, iframe is used to display a web page within another website.