how to add a background to text in html
.white_bg
{
background-color: #ffffff;
padding: 3px; /*add this if you want a bit of space around the text*/
}
<span class="white_bg">Your text here</span>
how to add a background to text in html
.white_bg
{
background-color: #ffffff;
padding: 3px; /*add this if you want a bit of space around the text*/
}
<span class="white_bg">Your text here</span>
fill color behid text in html
Put the text in an inline element, such as a <span>.
<h1><span>The Last Will and Testament of Eric Jones</span></h1>
And then apply the background color on the inline element.
h1 {
text-align: center;
}
h1 span {
background-color: green;
}
An inline element is as big as its contents is, so that should do it for you.
fill color behid text in html
Option 1
display: table;
no parent required
h1 {
display: table; /* keep the background color wrapped tight */
margin: 0px auto 0px auto; /* keep the table centered */
padding:5px;font-size:20px;background-color:green;color:#ffffff;
}
<h1>The Last Will and Testament of Eric Jones</h1>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us