What is the difference between block-level elements and inline elements

block level element

Block-level elements occupy one line by default

Block-level element width and height, line height, and margins and padding are all controllable

Elements in the line

Inline elements are also called inline elements or inline elements. Inline elements and other elements are on a single line, and the height, line height, padding, and margins cannot be changed. The width is the width of its text or image, and it cannot be changed. Inline elements can only hold text or other inline elements.

padding can be set

margin is only available on the left and right sides, not on the top and bottom

 

Guess you like

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