HTML basic tutorial block elements and line elements
Block elements
Block elements usually occupy one line by themselves. Regardless of the content, they always occupy one line.
What are the block elements? <div>, <p>, <h1>, <h2>, <pre>, etc.
#Inline elements
- Inline elements will not occupy a separate line.
- The width of inline elements is mainly determined based on the content.
- Multiple inline elements will be arranged on the same line.
- What are the inline elements? <font>, <b>, <i>, <u>, <sub>, <sup>, etc.
You should pay attention to this when typesetting. Multiple inline elements will be arranged in one line. If you want to break a line, you must use a line break tag, and a block element occupies a separate line