I have this class on CSS :
.mgmtError{ width:716px; float:left; background-color:#FF0000; padding:10px; text-align:center; }
and I'd like to color the background not in the padding area. I tryed with margin, but seems that it have some troubles with IE.
Any others solution?
Rather than leave the padding transparent, you can add color to the padding since the background color doesn't fully extend past the text element.
The padding-box value means that the only the padding box part of the HTML element has the background image rendered. The content-box value means that the only the content box part of the HTML element has the background image rendered.
you can use background-origin:padding-box; and then add some padding where you want, for example: #logo {background-image: url(your/image. jpg); background-origin:padding-box; padding-left: 15%;} This way you attach the image to the div padding box that contains it so you can position it wherever you want.
You can use
background-clip: content-box;
Also make sure to use background-color
property, not background
.
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