: Do span elements in the middle of a word affect a crawler's ability to detect content? I have a site with a heading tag like this: <h1><span class="initial">H</span>andyman <span
I have a site with a heading tag like this:
<h1><span class="initial">H</span>andyman <span class="initial">S</span>ervices</h1>
I've done this so that I can apply a bigger font size to the first letter of each word. However, in webmaster tools I see the keyword 'andyman' under Optimization > Content Keywords
Is that anyway to acheive a bigger font size for first letter) without effecting a webcrawlers ability to detect the word?
Update:
I can't simply use text-transform: capitalize as the element in question already has text-transform: uppercase; and I would like the effect to more dramatic than that provided by the uppercase letters of most fonts.
More posts by @Sims2060225
4 Comments
Sorted by latest first Latest Oldest Best
Google is clearly reading the rendered HTML and separating the word because of the span tag. Since headers are pretty important to tell Google what keywords are a little more important on your page than others you may re-consider your code to be semantically correct. While you get a nice looking header is it worth it if google sees andyman instead of Handyman
You can also use CSS and the :first-letter psuedo-element like this
jsbin.com/acagop/2/edit#html,live
Edit to demonstrate multiple words: jsbin.com/acagop/4/edit#html,live
Edit to demonstrate Raffael Luthiger's idea to wrap entire words: jsbin.com/acagop/6/edit#html,live
<style>
h1:first-letter {
font-size:300%;
color:red;
}
</style>
<h1>Welcome</h1>
You could use jQuery to select the first character and change it on the fly, so crawlers wouldn't see the span.
Refer stackoverflow.com/questions/3039397/jquery-select-first-letter
Update:
There is a plugin for this feature as well: 812studio.com/initial-letter-a-jquery-plugin-for-making-drop-caps-and-more/
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.