Do you have an idea to add a "background-color" property on a multi-line text, with two difficulties:
Example :
Thanks !
Use text inside :after pseudo element to make appear text as the background. Output: Using :before pseudo elements: Using :before pseudo elements with :before pseudo elements having lower z-index value make it to appear as background. Use text inside :before pseudo element to make appear text as the background.
A bit late to the party, but, you could use a <p> tag instead of a <span> , that will apply the padding to all lines.
How to Add Background Color in HTML. To add background color in HTML, use the CSS background-color property. Set it to the color name or code you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a table, heading, div, or span tag.
I think this is what you are looking for: http://jsfiddle.net/9BTYQ/1/
span {
color: white;
background-color: #343132;
box-shadow: 0.5em 0 0 #343132,-0.5em 0 0 #343132;
}
div {
width: 100px;
}
<div>
<span>Do you have an idea to add a background-color property on a multi-line text, with two difficulties:</span>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With