<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呢?
Are you sure the margin and padding have been cancelled?
Add display:block
to the
a tagimg tag or add font-size:0 or line-height:0
to the
Because img is an inline element, the outer layer has a default line-height
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?