我有2个元素不响应margin: 260px 0 0 0;
或margin-top: 260px;
。我不知道为什么。当我在IE中打开开发工具并检查元素时,边距在那里,但是元素停留在div顶部,好像根本没有设置margin: 260px 0 0 0;
。边距不工作的某些元件
为什么在.SideContainer a {...}
或.RightSide a {...}
内的a
元素的边距不能工作?
<section class="RightSide SideContainer">
<a href="~/Shared/Services/WebDevelopment">Packages & Pricing</a>
</section>
.SideContainer h1 {
color: white;
}
.SideContainer a {
margin: 260px 0 0 0;
padding: 10px 15px 10px 15px;
background-color: #ec462f;
color: white;
}
.RightSide {
float: right;
}
.RightSide a {
margin-top: 200px;
}
HTTP ://www.techrepublic.com/article/learn-distinctions-between-inline-and-block-html-elements/6094821 –