Search
 
SCRIPT & CODE EXAMPLE
 

HTML

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.
Comment

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>
Comment

PREVIOUS NEXT
Code Example
Html :: twig lower 
Html :: menu hamburguer html 
Html :: common sample sql databases for practice 
Html :: table design in html 
Html :: how to make a class in html 
Html :: how to put keywords on your html website 
Html :: script attach in html 
Html :: reduce the width of google recaptcha 
Html :: liens hypertexte html mdn 
Html :: radio buttons in bootstrap 
Html :: how to attach pdf on whatsapp through html url 
Html :: html input checkbox checked 
Html :: embed png in html 
Html :: mysql data to html table 
Html :: style font in html 
Html :: striped table bootstrap 
Html :: vue bind 
Html :: div class link 
Html :: tooltip 
Html :: Combining <symbol with <use SVG tags on a HTML page 
Html :: tag field 
Html :: how to say what happens on left click in HTML 
Html :: django html in vscode 
Html :: mat-form date pickerwith hints 
Html :: what is the best programming language in 2021 
Html :: node js barcode generator 
Html :: js coding practices airbnb 
Html :: bootstrap links 
Html :: angular call function from html 
Html :: html classes 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =