When I have a <div> that has different lines of text in it, I use inline font-sizes like this:
<div class="box1">
<font size="5" color="#000000" face="Tahoma" >This Is The Headline</font><br />
<font size="2" color="#000000" face="Arial" >This is the additional text.</font>
</div>
I realize my methods may be out of the html stone-age, but it seems to work fine, except for in IE7.
I’m not sure why the font doesn’t conform to the size that appears correctly when viewed in IE8 & IE9.
Is there something I can do on the IE7 stylesheet, to make the inline font sizes appear correctly, like they do when viewed in IE8 & IE9?
Thanks for the enlightening reply. Much appreciated.
I’m using CSS for the div class box1 attributes.
So, the proper way is to span the different font-sized lines of text, and have a coresponding span class in CSS for each different font-sized line of text? Would that bring me closer to the modern era of html?
Also, I’m not familar with this: .box1 span {dispaly: block;} - can you enlighten me on this?
Certainly it’s one way to do it, and pretty common. It means you can use those same styles across your whole site, and change them in one place (in your style sheet) if you decide to change something later.
Also, I’m not familar with this: .box1 span {dispaly: block;} - can you enlighten me on this?
As tunnil says, it’s setting any span inside box1 to “block” display. I did that just as a way of avoiding the <br> that you have in your HTML. An element det to display: block sits on a line of its own.
If the rule was just span {display: block} it would apply to all spans on your site, but by adding .box1 span {dispaly: block;} it limits the rule just to spans inside a div with a class of “div1”.
I would throw away the inline styling for the html stone-age ( ) and use spans and mentioned earlier. If you still want to do this inline you could do it this way:
<p style="font: 14pt Tahoma; color:#000;>This is the headline</p>