CSS大师Chris Coyier有一篇关于CSS-Tricks
listing several methods to solve this的文章.一种方法是带有box-shadow的方法.它已经被提到作为答案,但它需要更多的爱在现代Firefox :)工作.
.multi-line-padded {
background: black;
color: white;
/* For the top and bottom padding */
padding: 0.5em 0;
/* Text height (1.0) + compensate for padding (0.5 * 2) */
line-height: 2;
/* For the left and right padding */
/* Vendor prefixes FIRST */
-webkit-box-shadow: 1em 0 0 black, -1em 0 0 black;
-moz-box-shadow: 1em 0 0 black, -1em 0 0 black;
box-shadow: 1em 0 0 black, -1em 0 0 black;
/* Firefox defaults to `box-decoration-break: split`, we need `clone` */
box-decoration-break: clone;
}
You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder.