Need 2 different size fonts in the same header

use a span its the most appropriate element to use since its a inline style

That’s not appropriate criteria to determine semantics.

In this case, and thanks to @mittineague for reminding me, the TIME element would be more correct since he’s using HTML5.

If he was using HTML 4, span would be adeccuate because there would not exist any element that could provide that semantic meaning, and a span is just a empty inline container, with no meaning at all.

But if you have the chance to provide semantic meaning, you should

Yes you will need at least two tags, no matter how you code it. HOWEVER, you may already NEED two tags, depending on your semantics. ALWAYS THINK SEMANTICS FIRST.

I humbly question why you have a header with time in it… but it’s impossible to tell w/o seeing the full context in which it’s used. None the less you could do:

<h4><time  datetime="2014-02-11">2/11/14</time> Some Text</h4>
h4{
   font-size: 180%;
   line-height: 1.5;
}
h4 time{ font-size: 133%;}

hope that helps

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.