<body>
<div class="item></div>
<div class="item></div>
</body>
.item {
display: inline-block;
width: 100px;
height: 100px;
}
.item:nth-child(2) {
margin-top: 100px;
}
为什么把第二个item的margin-top设置为100px,另一个item的也会跟着移动?
<body>
<div class="item></div>
<div class="item></div>
</body>
.item {
display: inline-block;
width: 100px;
height: 100px;
}
.item:nth-child(2) {
margin-top: 100px;
}
为什么把第二个item的margin-top设置为100px,另一个item的也会跟着移动?
13 回答13k 阅读
7 回答2.2k 阅读
5 回答1.5k 阅读
3 回答1.3k 阅读✓ 已解决
5 回答1.7k 阅读✓ 已解决
6 回答1.3k 阅读✓ 已解决
2 回答1.4k 阅读✓ 已解决