1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'White Hat SEO' started by webdevkev, Oct 23, 2009.

  1. webdevkev

    webdevkev Newbie

    Joined:
    Jun 4, 2009
    Messages:
    3
    Likes Received:
    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
     
  2. TheNinja

    TheNinja Registered Member

    Joined:
    Jul 4, 2008
    Messages:
    83
    Likes Received:
    23
    Location:
    Hell
    Why wrap it in a div? Just create a stylesheet. Alot cleaner code, which will aid in SEO.
     
  3. Sippy79

    Sippy79 Junior Member

    Joined:
    Feb 13, 2009
    Messages:
    104
    Likes Received:
    26
    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 ;-)
     
  4. kanshu

    kanshu Regular Member

    Joined:
    Sep 11, 2009
    Messages:
    212
    Likes Received:
    28
    Occupation:
    Computer programmer
    Location:
    Cebu City, Philippines
    Home Page:
    <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.
     
  5. ukescuba

    ukescuba Jr. VIP Jr. VIP Premium Member

    Joined:
    Feb 24, 2008
    Messages:
    994
    Likes Received:
    634
    Occupation:
    Mobile Marketer & QR Code Junkie
    Location:
    San Antonio, TX
    Home Page:
    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: Oct 24, 2009