vineld Posted July 26, 2009 Share Posted July 26, 2009 I am modernizing a site and in the process I have switched to XHTML 1.0 Strict. It did not mean too many changes in this case although there was one problem I ran into. There are quite large code blocks with mouseover effects that reside within a DIV. Inside there are several other DIVs, paragraphs and images. Changing this would mean some messy restructuring which doesn't sound very appealing to me. Is there any good easy solution to this problem? I don't really wish to use JS since search engine bots may not like it. I am actually considering leaving it as is even though it doesn't validate. After all, it does work. Quote Link to comment Share on other sites More sharing options...
abazoskib Posted July 26, 2009 Share Posted July 26, 2009 you try XHTML 1.0 Transitional? edit: on second thought, why dont you run it through a tidy validator, or the online xhtml validator. it will give you suggestions on how to fix it. Quote Link to comment Share on other sites More sharing options...
vineld Posted July 27, 2009 Author Share Posted July 27, 2009 Changing the doctype is just avoiding the issue and not a solution. Of course I have run it through a validator. I know what the problem is (block-level and inline elements), and so do most of you I assume, but I still need to find a neat solution that would preferably not include JS. Quote Link to comment Share on other sites More sharing options...
haku Posted July 27, 2009 Share Posted July 27, 2009 The problem is the semi-colon in line 36 of your code. Quote Link to comment Share on other sites More sharing options...
vineld Posted July 27, 2009 Author Share Posted July 27, 2009 Haha I'm not sure if that was a joke or just plain sarcastic The problem is actually very straight-forward. I need to use a block-level element as a link in an SEO friendly manner. Although I know that is not a good idea, that is how the code looks today and it's not really my fault. Quote Link to comment Share on other sites More sharing options...
haku Posted July 27, 2009 Share Posted July 27, 2009 It was kind of a joke, kind of sarcastic - basically if you don't show us your code, it's pretty hard to give you any specific kind of help. All I can say in a generally is expand your links to be the full size of the area they have to cover, then inside them you can use spans instead of divs - this could solve your problem. Quote Link to comment Share on other sites More sharing options...
vineld Posted July 27, 2009 Author Share Posted July 27, 2009 The old code is messy, output by php with inline css and therefore not very reader friendly. That was why I opted against displaying it in the first place. I don't really wish to replace any elements as they seem to be fairly logical as they are. I think I will go for this solution nonetheless: 1. Add a JS onclick link to the surrounding div for the link. 2. Add two separate html links for an image and a header which are the only relevant items for the target url itself. This is really turning into SEO now I guess... Sorry about that. Would this solution be a good idea do you think or will the search engines frown upon this? After all, it may seem strange with two links for the same page and then a js link that surrounds them...? Quote Link to comment Share on other sites More sharing options...
haku Posted July 27, 2009 Share Posted July 27, 2009 As far as your SEO is concerned, the search engines won't even see the javascript link - search engine bots are not javascript enabled. The two links on the other hand - some people are of the opinion that that can be a bad thing. I'm not convinced myself, but I'm no SEO pro, just an intermediate. Quote Link to comment Share on other sites More sharing options...
vineld Posted July 27, 2009 Author Share Posted July 27, 2009 Thanks for your two cents. I think I'll stick with just using the text as a link since it doesn't really matter. What you said is not entirely true though. Even though the Googlebot can't execute javascript it does at times read javascript and might take that into account depending on the situation. Quote Link to comment Share on other sites More sharing options...
haku Posted July 27, 2009 Share Posted July 27, 2009 Got any links for that? First I've heard of it - if it's true, I may adjust some of the way I do things. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.