我有一个具有以下样式的 pre 元素:
pre {
background: #555;
background-image: -webkit-linear-gradient(#555 50%, #505050 50%);
background-image: -moz-linear-gradient(#555 50%, #505050 50%);
background-image: -ms-linear-gradient(#555 50%, #505050 50%);
background-image: -o-linear-gradient(#555 50%, #505050 50%);
background-image: linear-gradient(#555 50%, #505050 50%);
background-position: 0 0;
background-repeat: repeat;
background-size: 4.5em 4.5em;
color: #fff;
font-size: .8em;
line-height: 2.25;
margin: 0 -2.25em 2.25em;
overflow: auto;
padding: 2.25em;
}
为什么在滚动pre
元素时会忽略右填充?我不想换行,我想要这种行为(这不是基于规范的预期行为,但似乎在 webkit 中工作):http: //jsfiddle.net/joshnh/Ly5kz/
这是一个现场示例的链接:http: //joshnh.com/2012/08/14/making-a-pure-css-featured-image-slider/#step1