Part of site I'm working on p tag over a background image:
I've set the background color for the tag and also the padding but for whatever reason I cant just get it to be a solid block of color behind the text
Part of site I'm working on p tag over a background image:
I've set the background color for the tag and also the padding but for whatever reason I cant just get it to be a solid block of color behind the text
span {
font-size: 2.2rem;
}
.bg-pad {
background: #c0392b;
color: #fff;
line-height: 3rem;
}
<span class="bg-pad">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat quisquam quas nesciunt quaerat consequatur, illum ipsa accusamus, optio molestias quae id autem praesentium quia, nostrum quis, velit dolorem. Magni, magnam. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugiat quisquam quas nesciunt quaerat consequatur, illum ipsa accusamus, optio molestias quae id autem praesentium quia, nostrum quis, velit dolorem. Magni, magnam.</span>
p {
padding: 5px;
background-color: red;
}
span {
background: #c0392b;
color: #fff;
line-height: 3rem;
}
<p>
lor ut congue egestas, odio urna facilisis tortor, sed tempor ex metus at leo. Maecenas ac sem ut ante porta sodales.</p>
<span>lor ut congue egestas, odio urna facilisis tortor, sed tempor ex metus at leo. Maecenas ac sem ut ante porta sodales.<span>
Hi, You just have to put the padding and the color in CSS to apply the style. if you wanted you could also determine the background of the text as "background-color: transparent" and achieve a different effect.
you can place your paragraph inside a div. and set background to this
div{
background:orange;
color:white;
}
section{
background:url(https://picsum.photos/458/354);
height:200px;
}
<section>
<div>
<p>Any text wth long description, you can write anything here becuase i have a background form div. and i will not longer see you space behind me.Any text wth long description, you can write anything here becuase i have a background form div. and i will not longer see you space behind me.Any text wth long description, you can write anything here becuase i have a background form div. and i will not longer see you space behind me.
</p>
</div>
</section>