css - div block 内的填充不可见?

标签 css

请检查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>

最佳答案

您只是输入错误。

use padding property

like: padding: 10px;
insteade of: 10 px;

参见Fiddle demo

关于css - div block 内的填充不可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44983224/

相关文章:

css - css中的负右边距

html - 在背景图像上褪色图像

html - 使用CSS的水平下拉菜单

javascript - 如何将 css 样式表和 js 文件调用到自定义 WordPress 主题中

css - 试图在鼠标进入时使用悬停显示可点击的图像

html - 如何修复 GridView 中的这个单元格?

javascript - 如何防止浏览器绘制的 img 不可见?

javascript - React - 制表符时防止焦点脱离模态

html - CSS 样式在 FF 和 IE 中正确定位,但在 Chrome 中不正确

html - 如何反转使用 CSS 创建的五边形?