Home > Article > Web Front-end > What are inline and block-level elements?
Inline elements include a, span, strong, b, em, i, label, img, input, select, textarea, button, abbr, cite, code, big, small, sub and sup, etc. Block-level elements include div, p, h1-h6, form, ul, ol, dl, dt, dd, li, table, tr, td, th, hr, blockquote, address, menu, pre, etc.
The operating system for this tutorial: Windows 10 system, DELL G3 computer.
Inline elements and block-level elements are two different types of elements in HTML. They have different characteristics and behaviors in page layout and style. Common inline elements and block-level elements are listed below:
Inline elements:
1. a: hyperlink.
2. span: Inline element, used to combine document content.
3. strong: Emphasize the text and display it in bold.
4. b: Define bold text.
5. em: Define emphasized text, displayed in italics.
6. i: Define italic text.
7. Label: Define the label of the form control.
8. img: Define image.
9. Input: Define the input control.
10. select: Define the drop-down list.
11. textarea: Define a multi-line text input box.
12. button: Define the click button.
13. abbr: Define abbreviations.
14. cite: Define reference.
15. code: Define computer code text.
16. big: Define larger text.
17. small: Define smaller text.
18. sub: Define subscript text.
19. sup: Define superscript text.
Block-level elements:
1. div: block-level element, used to combine document content.
2. p: Define paragraph.
3. h1-h6: Define the title, h1 defines the highest level title, and h6 defines the lowest level title.
4. form: Define the form for user input.
5, ul, ol, dl: Define unordered list, ordered list and definition list respectively.
6, dt, dd: respectively define the items in the list and the description of the items in the list.
7. li: Define list items.
8. table: Define the table.
9. tr: Define rows in the table.
10, td, th: Define the cells and header cells in the table respectively.
11. hr: Define the dividing line between topics.
12. blockquote: Define long quotes.
13. address: Define address information.
14. menu: Define menu list.
15. pre: Define pre-formatted text, retaining formatting information such as spaces and newlines.
The above is the detailed content of What are inline and block-level elements?. For more information, please follow other related articles on the PHP Chinese website!