Understand the basic usage of <div>

Definition and Usage

<div> can define a division or section (division/section) in the document.

The <div> tag can divide the document into separate, distinct parts. It can be used as a strictly organizational tool and is not associated with it using any formatting.

If you tag the <div> with an id or class, the tag becomes more effective.

usage

<div> is a block-level element. This means that its content automatically starts a new line. In fact, line wrapping is the only formatting behavior inherent in <div> . Additional styles can be applied via the <div>'s class or id.

You don't have to add a class or id to every <div>, although there are some advantages to doing so.

Either the class or id attribute can be applied to the same <div> element, but it is more common to apply only one or the other. The main difference between the two is that class is used for groups of elements (similar elements, or can be understood as a class of elements), while id is used to identify individual unique elements.

Differences between HTML and XHTML

In HTML 4.01, the "align" attribute of the div element is deprecated.

In the XHTML 1.0 Strict DTD, the "align" attribute of the div element is not supported.

Tips and Notes:

Note: <div> is a block-level element, that is, browsers usually place a line break before and after a div element.

Tip: Use the <div> element to group block-level elements so they can be formatted with styles.


Keywords: seo optimization  stock allocation   stock allocation platform


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324665115&siteId=291194637