PDA

View Full Version : H1 and span tag



Mike
06-18-2008, 01:08 PM
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.


<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

Chris
06-18-2008, 02:22 PM
It could... You never know if SE's would factor out the tag when figuring keyword density.

Mike
06-18-2008, 03:35 PM
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 :)

Chris
06-18-2008, 04:52 PM
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
06-18-2008, 04:52 PM
You may be able to do it with js too after the page loads

Mike
06-19-2008, 06:44 AM
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?

Chris
06-19-2008, 10:11 AM
You never know, it probably isn't a big deal anyways, it depends on how much of a SEO nazi you wanna be.

Dan Schulz
06-22-2008, 10:40 PM
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:



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:



.example span {
/* CSS code for span inside heading with class of example */
]




#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).

bermuda
06-24-2008, 10:26 AM
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.