Home > Article > Web Front-end > Compilation of solutions to small css problems_html/css_WEB-ITnose
1, the image is vertically centered:
Set the div containing the image: height=20px; line-height=20px. Just set image vertical-align: middle.
2. The inline block element has a 3px bug, which can be solved by setting it to a block element. Typical elements: img input
Inline elements: The content expands the width and height. The width and height change with the change of the content. The width and height cannot be controlled. It is used to control fonts and colors. Line-height can be set
Block-level elements: Default is full line, can be set.
Block-level elements can include inline elements and block-level elements. Inline elements cannot contain block-level elements.