In the next Caishuxueqian, deficiencies, please also advise.
Vertical-align is a useful property in CSS, commonly used in checkboxes and text alignment, picture alignment and other positions.
Note that there is a need for an element to be inline or inline-block (Table-cell can also be understood as inline-block level), and its vertical-align attribute will work, in fact, well understood, for block element is directly on its own line and does not need to be aligned.
Common vertical-align Usage: middle (centerline alignment), top (aligns the top of the element to the top of the top element), 2px (height up and down).
See the following code
<! DOCTYPE html> test{ Vertical-align:2px; } </style>
The execution effect is as follows
Next look at a picture aligned:
<! DOCTYPE html> img{ width:600px; height:300px; Vertical-align:middle; } </style>
The execution effect is as follows
By demo, we know that Img,span is an inline element
Actually, block-level elements are one of the few:<div>
CSS3 's vertical-align--, I understand.