Img process and present spacing element designed html

In studying the development of pen and odd novels when the site, what problems encountered

Problems:

Set in the initialization CSS in the img the padding and margin to zero, but after insertion img, img parent element still has some distance.

 

Cause Analysis:

The default text pictures, inline elements aligned with the baseline of the parent element, while the bottom baseline of the parent element is a certain distance (with the font-size, font-family related settings related). Pictures or text elements to add vertical-align: top or middle, bottom and so solve the problem.

Problem Solving Code:

.header-body img{vertical-align: middle;}

 

Guess you like

Origin www.cnblogs.com/is-jackwen/p/10926554.html