View Single Post
Old 06-15-2020, 12:35 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,277
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by hobnail View Post
In my html I have

Code:
 <h2>One <span>Old Man Arlo’s dogs</span></h2>
The text in the span gets moved to its own line with display:block. I also want it larger than the h2 text. In my css I have

Code:
h2 span {
    display: block;
    font-size: larger;
}
I don't specify a font-size in the css for the h2 tag; I'd rather keep things simple and let the ereader use whatever size it uses. I'd like to make the h2 text even smaller but if I put font-size:smaller in the css for the h2 that also makes the text in the span smaller. Is there a way to make the h2 text smaller and keep the span text larger, only with css? (Without adding a span around the "One" for example.)
Code:
 <h2>One <span class="h2">Old Man Arlo’s dogs</span></h2>
Code:
.h2 {
    font-size: larger;
}
That will do what you want.
JSWolf is offline   Reply With Quote