Home  >  Article  >  Web Front-end  >  What is a block element in css

What is a block element in css

王林
王林Original
2021-07-12 15:04:293095browse

In CSS, block elements are also called row elements, which support all styles. If no height is set, the width of the block element is 100% of the parent's width. The block element takes up one line in the box, even if we set the width.

What is a block element in css

The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.

Block element can also be called a row element. Commonly used tags in layout are:

  • div

  • p

  • ul

  • li

  • ##h1 - h6

  • dl

  • dt

  • dd

The above are all block elements, they are The behaviors in the layout are:

  • Support all styles

  • If the width is not set, the default width is 100% of the parent width

  • The box occupies one line, even if the width is set

Related video tutorial:

css video tutorial

The above is the detailed content of What is a block element in css. 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