Home  >  Article  >  Web Front-end  >  How to use div layout?

How to use div layout?

little bottle
little bottleOriginal
2019-05-11 16:59:3812488browse

DIV is the positioning technology in cascading style sheets, the full name is DIVision, which means division. Sometimes they are called layers. DIV is also called integer divisibility in programming, that is, only the integers of the quotient can be obtained. The DIV element is an element used to provide structure and background for block-level content within an HTML (an application under Standard Universal Markup Language) document.

How to use div layout?

dc6dce4a544fdca2df29d5ac0ea9906b is a block-level element. This means that its contents automatically start on a new line. In fact, line breaks are a specific formatting behavior inherent to dc6dce4a544fdca2df29d5ac0ea9906b. Additional styles can be applied via the dc6dce4a544fdca2df29d5ac0ea9906b's class or id.

It is not necessary to add a class or id to every dc6dce4a544fdca2df29d5ac0ea9906b, although there are certain benefits to doing so.

It is possible to apply both class and id attributes to the same dc6dce4a544fdca2df29d5ac0ea9906b element, but it is more common to apply only one of them. The main difference between the two is that class is used for groups of elements (similar elements, or can be understood as a certain type of elements), while id is used to identify individual specific elements.

Example:

<body>
<h1>NEWS WEBSITE</h1>
<p>some text. some text. some text...</p>
...
<div class="news">
<h2>News headline 1</h2>
<p>some text. some text. some text...</p>
...
</div>
<div class="news">
<h2>News headline 2</h2>
<p>some text. some text. some text...</p>
...
</div>
...
</body>

The above is the detailed content of How to use div layout?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn