What is the purpose of the span? Screenreader users won't see the
colors. If it's for emphasis, you might want to do something like this
instead:

Markup:
<h1><strong>Leroy</strong> <em>Jenkins</em></h1>

CSS:
h1.strong {color:blue;}
h1.em {color:red}

Add additional CSS settings to each of the above to change what the
browser defaults will be doing to those tags.

An advantage to this approach vs setting Leroy's color in the header tag 
is that you're free to use <h1> tags elsewhere without them also being 
Leroy's color. Plus screenreaders can properly indicate the different 
degrees of emphasis.

Ben Liu wrote:
> Apologies if this has been answered before. What is the semantically
> correct method of coding a two color header? Is this the optimal
> syntax:
> 
> <h1><span class="blue_part_of_the_header">Leroy</span><span
> class="red_part_of_the_header">Jenkins</span></h1>
> 
> .blue_part_of_the_header {color: blue;}
> .red_part_of_the_header {color: red;}
> 
> Thanks for any help.

-- 
David
[EMAIL PROTECTED]
authenticity, honesty, community

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to