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

  • Format text in HTMLFormat text in HTML
    format elements in html help determine the style and importance of text.
  • Elements in HTMLElements in HTML
    the html element usually goes in pairs, including the opening tag, closing tag, and the content inside the two tags.
  • Symbol - Icon in HTMLSymbol - Icon in HTML
    html has many mathematical, technical and monetary symbols that cannot be used to write.
  • Common HTML mistakes that you should avoid for better web programmingCommon HTML mistakes that you should avoid for better web programming
    learning html is not difficult, but when running it in the browser, errors often occur. here are common html errors and how to handle them for better web development.
  • How to insert spaces in HTMLHow to insert spaces in HTML
    this tutorial explains how to insert spaces and line breaks in html. because no matter how many times you type a space, html will display a space so to insert more than one space, you will need to use the html tag.
  • Image img in HTMLImage img in HTML
    when you visit the website, you will often see images of all sizes and positions on the page. images in html web pages will help to enrich the content as well as increase the aesthetics of the page.
  • Attributes in HTMLAttributes in HTML
    properties are used to add information to elements in html.
  • The id attribute in HTMLThe 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).
  • Table in HTMLTable in HTML
    what does it take to create a table in html? is it complicated? want to add color to the table border, how to add the background color to the text in the table? in this article tipsmake.com will answer those questions and guide you to basic operations with tables on html, in addition to adding alternate color schemes for rows in the html table. invite you to follow along.
  • Title in HTMLTitle in HTML
    it is very important to use the title to show the text structure. heading (html) in html is identified by tags marked from to, of which the most important title is the least important.