Warning: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ..../includes/class_bbcode.php on line 2083
H1 and span tag
Results 1 to 9 of 9

Thread: H1 and span tag

  1. #1
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755

    H1 and span tag

    Hi all,

    I'm using the following code for headings one on of my sites, as I want the last word of the text to be formated differently.

    HTML Code:
    <h1>First<span class="blue">Second</span></h1>
    My question is, will this have any negative impact in relation to being se-friendly? I presume it won't matter having the span tag there?

    Thanks,
    Mike
    Don't you just love free internet games ?

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    It could... You never know if SE's would factor out the tag when figuring keyword density.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755
    Hmmm... I don't think there is another way it could be achieved though.

    Looks as though I may have to think of something else
    Don't you just love free internet games ?

  4. #4
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Well you may be able to limit it by getting rid of the class definition.

    You can do nested CSS definitions, so spans within h1's.

    The exact syntax escapes me.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  5. #5
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    You may be able to do it with js too after the page loads
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  6. #6
    Registered Mike's Avatar
    Join Date
    May 2003
    Location
    UK
    Posts
    2,755
    Yeah I think I'll just try and limit it, getting rid of class then. You'd think that Google would ignore the tag though wouldn't you?
    Don't you just love free internet games ?

  7. #7
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    You never know, it probably isn't a big deal anyways, it depends on how much of a SEO nazi you wanna be.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  8. #8
    Quahog's Most Wanted Dan Schulz's Avatar
    Join Date
    Feb 2007
    Location
    Aurora, Illinois
    Posts
    91
    Given that I use only one H1 per page anyway, you could just remove the class from the SPAN (besides, what if you want that span to be red next week instead of blue? When using classes I always go with meaningful names, not presentational ones) and then target it via the heading, like so:

    Code:
    h1 span {
    	/* CSS declarations for the span inside the H1 heading */
    }
    If you need to target a span inside a particular heading, then place a class or ID on the heading and then reference the span from there, like so:

    Code:
    .example span {
    	/* CSS code for span inside heading with class of example */
    ]
    Code:
    #example span {
    	/* CSS code for span inside heading with ID of example */
    }
    Ad as far as the search engines are concerned, no, I don't think it'll have any impact if done correctly (and legitimately).
    "Far away in cyberspace are my highest aspirations. I may not reach them, but I can envision their beauty, believe in them, and try to follow where they lead me."
    —Anonymous

  9. #9
    Registered
    Join Date
    Feb 2007
    Posts
    104
    On nearly all of the cases in which H1 tags are being used, the webmasters try moving the classes and decorations to the CSS external file as H1 tags need to be alone to be more effective.

Similar Threads

  1. When resized to 800x600 border does not span 100%
    By deronsizemore in forum HTML, CSS, Layout, and Design
    Replies: 2
    Last Post: 08-04-2006, 02:47 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •