<p>
<a href="">
<img src="images/1.jpg" alt="">
</a>
</p>
css
*{
margin: 0;padding: 0;
}
@media (min-width: 320px) {
html {
font-size: 100px;
}
}
@media (min-width: 360px) {
html {
font-size: 112.5px;
}
}
@media (min-width: 400px) {
html {
font-size: 125px;
}
}
p{
margin: 2%;
}
a{
display: block;
}
img{
height: .64rem;
}
为什么img的高度是64px,而a的高度是114px呢?
高洛峰2017-04-17 11:33:14
Add display:block
to the
img tag or add font-size:0 or line-height:0
to the
怪我咯2017-04-17 11:33:14
Because img is an inline element, the outer layer has a default line-height
PHP中文网2017-04-17 11:33:14
em is inheritable
If the img height is calculated in em, its height is 0.64*the font-size of the a element
If the iPhone 5 is simulated with the chrome browser, the result is
img high 80px, element height is 125px
How did you come up with the combination of 64 and 114?