Hiding "H" tags (headings) CSS coding

seomedia

Registered Member
Joined
Mar 18, 2009
Messages
89
Reaction score
33

Quick question to you coders out there, regarding the hiding of h tags.

Which of the following CSS should be used? They both hide content but which is best for SEO or do the bots not even take this into account? It would be useful to know.

display:none

visability:none
 
I don't know whether there is a difference, but you take extra precaution by using javascript with whichever you choose. The bots are not fans of javascript.

My 2 Cents.
 
Use display:none; but why want you to hide the h tags which are pretty relevant to your sites SEO?
 
display:none doesn't use space but visability:none will.
let's say that the height of h tag is 10px when apply
display:none,it simply disappear and
visability:none you could still find out the existence of h from its height.
 
I think I understand what he intends to do. I figure he will make the H1 only appears in the underlying code but not on the page itself.
 
Sec-dee - correct. Much like a wordpress blog. Or many pages out there that actually have a title in the "logo image" rather than have text.

Thanks for the answers.
 
The diff between "display:none" and "visibility:none"

"display:none" does not show or take place on the design. Visibility is still taking up space on the page.
 
If you want to have an image but still want some SEO benefits you should consider shifting the h1 tag (hint: text-indent: -9999px;) and display an image instead :)
 
Interestingly this is how johnchow has set up his H1:

Code:
<div id="header">
		<div class="main">
			<h1 id="logo">
				<a href="http://www.johnchow.com/"><span></span>John Chow dot Com</a><br />
				<em>The Miscellaneous Ramblings of a Dot Com Mogul</em>
			</h1>
 
Yep and the related CSS:

Code:
#logo span {
background:transparent url(images/logo.png) no-repeat scroll 0%;
cursor:pointer;
height:60px;
left:0pt;
position:absolute;
top:0pt;
width:454px;
}

He is using an empty span to fill in the background image...Just another way :)
 
Back
Top