I. Block-level elements and row-level elements
To understand the differences between display: inline, block, and inline-block, you must first understand the features of block-level and line-level elements in HTML. In-line elements are also called
Css-inline (in-row) elements, block elements, margin, and padding
Features of block elements:
Always starts on a new line;Height, row height, and top and bottom margins can be controlled;The default width is 100% of its container unless a width is
The difference between block elements and inline elements.
Only one row can set the margin in the width, height, and vertical direction, and the margin and padding in the horizontal direction of padding.
Block Element: Yes, yes, yes
Inline element:
force line feed
the value exceeds the hidden value. Set the width.
Inline conversion to block: Display: block or float: left/right
Bulk conversion to inline: Display: inline;
However, you must note that the width and height cannot be set for
Only one row can set the margin in the width, height, and vertical direction, and the margin and padding in the horizontal direction of padding.
Block Element: Yes, yes, yes
Inline element: No, no
Question: Change the nine days of the next
An inline-level element (inline-level Element) attempted to insert a block-level (block-level Element) element. It is not allowed to do so. The only exception that can insert block-level elements in inline elements is the object label. So what are
An inline-level element (inline-level Element) attempted to insert a block-level (block-level Element) element. It is not allowed to do so. The only exception that can insert block-level elements in inline elements is the object label. So what are
The first thing we need to know is that all HTML elements are either blocks (block elements) or inline (inline elements). Here is a look at the characteristics of block and inline:
Features of the block element:
Always start on a new line;Height,
Differences between the three Display:box;display:inline;display:noneDisplay:block is characterized by:The block is the display default value.Always start on a new line;The contents of the object are then automatically wrapped;Both the row height
CSS document flow with block-level elements (block), inline elements (inline), before flipping through a lot of books, read a lot of articles, see what is fragmented CSS layout basic knowledge, comparison surface. Looking at the "CSS Authority Guide"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.