[thelist] A (simple?) HTML question...

Duncan Hill dunkaz at gmail.com
Tue Aug 19 13:56:00 CDT 2008

On Tue, 19 Aug 2008 12:29:54 +0100, Kevin Timmins  
<kipper_timmins at live.co.uk> wrote:

> Hi,
>> From my understanding of it both are fine and should validate with the  
>> w3c
> standards,
> personally i would go with a, because it just seems clearer to me, also  
> from
> the point of view of search engines, they will see that the link is a
> heading because it will read the heading first. I might be completely  
> wrong,
> but thats my 2c
> as long as you dont do <h2><a href="url>heading</h2></a> then it doesnt
> really matter i dont think.
> of course if you are using css then you might want to build a style that  
> you
> can build into the link,
> <a href="url" class="HL2">heading</a>
> that way, your style HL2, short for header link 2 can be different from
> unlined headers should you wish it to be.
> ps, i think you can use css and class' like that.
> hope this helps
> Kipper
It has already been noted that the syntax used for A. matches the correct  

If you use 'styling' to represent the heading by creating a class HL2, you  
have immediately thrown away any benefit to a search engine or assisitive  
technology to indicate that this text has special meaning.
Use the correct H2 or indeed Hx tag to create your headings in a semantic  
way and then set the styling in an appropriate way using correct CSS  

<h2> to a screen reader or a search engine is a level 2 heading within the  
document, it will display by default as a heading in any browser or  
reader, with or without CSS.

class="HL2" is comparatively meaningless, and is nothing more than a  
styled piece of text, that will revert to the default font if CSS is  
disabled or not available.

For example the H2 in a heading div can be styled by simply applying your  
declarations to
#heading h2{ .....
any of the other types of descendant or child etc. selectors can then be  
used without any additional markup.
You can happily create dozens of h2 styles if required providing you  
target accurately with your selectors.


> --------------------------------------------------
> From: "Nadeem Hosenbokus" <nadeem at multigraphics.biz>
> Sent: Tuesday, August 19, 2008 12:18 PM
> To: <thelist at lists.evolt.org>
> Subject: [thelist] A (simple?) HTML question...
>> Hi,
>> I've arrived at a point of indecision over something that looks like it
>> should be simple, straight-forward and in the domain of common knowledge
>> but
>> I can't find any solutions on the net.
>> Which is better? And why?
>> a) Link inside H2: <h2><a href="url">Heading</a></h2>
>> OR
>> b) H2 inside link: <a href="url"><h2>Heading</h2></a>
>> I'm leaning towards option (b) because I *think* it's better for SEO...
>> but
>> I'm not sure.
>> Thanks in advance,
>> Nadeem Hosenbokus
>> Exocet Studios - a brand of Multigraphics Ltd
>> Office:  (+230) 212 6390 / 208 6499
>> Mobile: (+230) 254 8221
>> Fax:     (+230) 212 6789
>> 24 St. Georges Street, Port Louis
>> www.multigraphics.biz
>> www.exocetstudios.net
>> --
>> * * Please support the community that supports you.  * *
>> http://evolt.org/help_support_evolt/
>> For unsubscribe and other options, including the Tip Harvester
>> and archives of thelist go to: http://lists.evolt.org
>> Workers of the Web, evolt !

More information about the thelist mailing list