Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the types of css elements

Shulou Source: shulou.com Published: 2022-06-03 17:33:19 11月13日 Update

This article introduces the relevant knowledge of "what are the element types of css". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Block elements are displayed in a rectangular area on the page.

Arrange from top to bottom, occupy a single line

You can add width and height directly and can be used as a container for other elements or content

Common block elements are: div, p, h2...h7, ol, ul, dl, table, address, blockquote, form, fieldset (form field set), colgroup-col (form column grouping element), table-tr-td

2, inline elements, the smallest unit on the page is also a rectangle.

Arrange in a line, not exclusive

Width and height cannot be added directly, the size is supported by the content.

Inline elements also conform to the rules of the box model, but individual attributes may have problems (padding-top) magin-top/bottom)

3. Inline block elements, inline block elements have the characteristics of both inline elements and block elements.

1) and other elements are on one line

2) the height, width, row height and top and bottom margins of the element can be set.

The conversion box model of element types can change the default display type through the display attribute

This is the end of the content of "what are the types of css elements". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Element block type content line attribute more model knowledge rectangle page practical minimum learned next region unit at the same time dilemma size Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Apple Xiaomi Docker MariaDB