请检查jsFiddle link并说明为什么在div容器中看不到填充?
body {
background-color: #B8C4BB;
}
.container {
text-align: center;
}
.section_two {
border: 2px solid red;
padding: 10 px;
}
<div class="container">
<div class="section">
Change the value of the color property to see how it changes the text color of this element.
</div>
<div class="section_two">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt, alias, aliquid fugiat dolorem repudiandae quidem. Molestiae illum pariatur officia voluptate cumque. Necessitatibus earum consequuntur explicabo minus ratione mollitia illum nam.
</div>
</div>
答案 0 :(得分:3)
答案 1 :(得分:1)
你的CSS如下:
.section_two {
border: 2px solid red;
padding: 10 px;
}
填充值无效。它应该是padding: 10px
。 10
和px
答案 2 :(得分:1)
它没有用,因为你在10和px之间放了一个空格。它应该像下面的代码一样。
.section_two {
border: 2px solid red;
padding: 50px;
}