In the CSS layout page, we will divide the HTML tags into two, block elements and inline elements (we usually use the div and P is a block element, link tag A is an inline element)
Block element
It is generally a container for other elements that can hold inline elements and other blocky elements, and block elements repel other elements to the same line, with width (width) height (height) in effect. Common block elements are div and p.
Inline elements
Inline elements can only hold text or other inline elements, which allow other inline elements to be on the same line, but the width height (height) does not work. Common inline elements are "a"
|
Block element |
Inline elements |
Whether to allow other elements to be in the same row |
No |
Yes |
Whether width and height work |
Yes |
No |
Address-Address
BLOCKQUOTE-block reference
Center-for aligning
Dir-directory list
Div-Common block-level easy, also the main label for CSS layout
DL-definition list
Fieldset-form control group
form-interactive form
H1 -Large title
H2-subtitle
h3-3 level title
H4-4 level title
H5-5 level title
H6-6 level title
hr-Horizontal divider
Isindex-input prompt
Menu-dish Single-column table
Noframes-frames optional content (this chunk content is displayed for browsers that do not support frame
NoScript-Optional script content (this content is displayed for browsers that do not support script)
ol-Sort form
P-paragraph
Pre-formatted Text
Table-table
ul-non-sorted list
Inline elements (inline element) include
A-anchor point
ABBR-Abbreviation
Acronym-the first word
B-Bold (not recommended)
Bdo-bidi Override
Big-Large font
BR-line break
Cite-citation
Code-Computer codes (required when referencing source)
DFN-Defining fields
EM-emphasize
Font-typeface settings (not recommended)
I-Italic
IMG-Images
Input-Enter box
KBD-Define keyboard text
Label-Table Label
Q-Short Reference
S-Medium dash (not recommended)
Samp-Define sample computer code
Select-Project Selection
Small-Small font text
Span-a common inline container that defines chunks within a text
Strike-Medium Dash
Strong-Bold Emphasis
Sub-subscript
SUP-Superscript
TEXTAREA-Multi-line text input box
TT-Telex text
U-Underline
var-Defining variables
* block elements and inline elements transform each other
Block elements into inline elements:CSS settings display:inline ;
Inline elements into blocky elements: CSS settings display:block;
Example:
CSS block elements and inline elements