Is <h1> is = to <h1 class="xyz">

webdevkev

Newbie
Joined
Jun 4, 2009
Messages
3
Reaction score
0
I was wondering if any one has an idea on this. Right now for visual look and feel we usually wrap the <h1> tags in a Div so we can make them look different.

We do the same for <h2> and so on.

But from a SEO perspective does the <h1> with a class carry less weight?

Thanks in advance

Kevin
 
Why wrap it in a div? Just create a stylesheet. Alot cleaner code, which will aid in SEO.
 
No its more clean in a semantic way of look. If you define <h1 class="abc"> then you can style it like this:

Code:
.abc {your style information}
^^ his will be applied to every tag you add the class "abc" (doesn't matters if h1, h2, a href etc.

Code:
h1.abc {your style information}
^^ this will be applied only to h1 tags with the class "abc"


So basically you don't need to wrap the <h1> tags into divs ;-)
 
<h1 class="xyz"> means you are overriding the current <h1> style. It's temporary. Not recommended because you're hardcoding style in the HTML part of your webpage. Do what Sippy79 says. It's better to do styling inside the CSS file.
 
not sure if im miss reading this thread but if you want to style your h1 header tags you would only need to do:

Code:
h1 {your style information}

if you wanted to make your header always the same style as your abc style all you would need to do is this:

Code:
h1,.abc {your style information}

or if you wanted to make your other styles the same...

Code:
h1,h2,h3,.abc {your style information}

there would be no need to use the style class:
Code:
 <h1 class="abc">

just

Code:
<h1>

would be fine... unless you wanted to remove the styling set in you css

additionally it would cut down on the amount of code on your page and make it load quicker...

hth unless im missing something
 
Last edited:
Back
Top