Tutorials

Latest Word » Tutorials » Markup Hierarchy – Advantages in SEO
seohier

Markup Hierarchy – Advantages in SEO

Tags:

Over the past year, we have been researching and testing the effects of markup hierarchy making a difference in search engine results. What I mean by markup hierarchy is that we want the unique and rich content to be at the highest point in the markup.

Why? First Read Chris Casarez’s Article

After several tests and reviews, we did see some improvements in search engine rankings as Chris Casarez (SEO Specialist at the Company) mentions in his article “Content Placement and Keyword Density matter“. The important aspect here is to move what the search engines loves to crawl to a higher point on the markup.

Although this is not recommended for every site out there, a lot of ecommerece sites with heavy headers and side columns may want to look into this technique to see if it has any positive effects on their rankings.

How can this be achieved?

We can achieve this effect by relying on a combination of floats and absolute positioning. Lets first take a look at the concept and visual layout of how we will be laying down our markup.

Markup Hierarchy with SEO

As you can see, our markup begins with the main content first, then it is followed by the header / top navigation, side navigation, then footer.

Markup Hierarchy with SEO

Development (CSS/XHTML)

I don’t want to bore you with every single detail of this technique, but lets go over the foundation of how this layout works.

HTML

<div id="main" class="container">
	<div id="content"><!--Unique Content--></div>
	<div id="header"><!--Header & Top Navigation--></div>
	<div id="sidecol"><!--Side Navigation--></div>
</div>
<div class="container">
	<div id="footer"><!--Footer--></div>
</div>

CSS

#content {
	float: right;
	width: 685px;
	margin: 120px 0 0 0;
	padding: 20px;
}
#header {
	width: 970px;
	position: absolute;
	top: 0; left: 0;
}
#sidecol {
	width: 235px;
	position: absolute;
	top: 150px; left: 0;
}
#footer {
	float: left;
	width: 970px;
}

Final Correction of Layout

One major flaw with this technique is that since the header and side nav is relying on absolute positioning, it will ignore any elements surrounding it. This means, if the content is shorter in length than the side navigation, the footer will seep through past the side column and rest below the shortened content. How can we fix this?

Set a minimum height on the wrapper that contains the side nav / content

#main {
	height: 100%;
	min-height: 724px;
	background: url(stretch.gif) repeat-y;
	position: relative;
	overflow: hidden;
}
*html #main { height: 724px; overflow: visible;} /*--If content is larger than 724px, IE6 will allow the content to break out of its element--*/

You can also use javascript to calculate the height of the side navigation / content and apply it to the #main wrapper. One issue I have run into before when doing this is that, anytime you use an accordion or toggle effect in the content, the script also calculated the max height of the content before the accordion/toggle collapses which lead to some massive white space towards the bottom.

Conclusion

There may be concerns with accessibility with this technique (most likely for text readers), since the content will be showing first, so I would recommend you research your visitors well and see if its appropriate for your situation.

Test throughly before you implement this on your/client’s site. The advantages we have gained with our ranking was pretty significant so it is definitely a plus for those who are optimizing their sites. If you have any questions, concerns, or suggestions, please don’t hesitate share them!

Related Posts

Author Bio

My name is Soh Tanaka and I am a Los Angeles based designer/front-end developer specializing in CSS driven web design with an emphasis on usability and search engine optimization. I also run a CSS Gallery which is updated daily with the best CSS websites from around the world. Come check it out!

You can learn more about me or Twitter  Follow me on twitter for more updates and resources!

Did You Enjoy This Post?

subscribe  Subscribe via RSS or by email to get all upcoming tutorials and articles delivered straight to you.

+ Add Comment44 Peeps Have Spoken Their Minds...

  1. Jitendra Vyas

    Good Article . We can add “skip to navigation” and “skip to sidebar” for screen reader

    . I will try this technique in practice.

  2. krishna

    This is something interesting. Making only the content into the top. i know search engines likes good content, but how good is it to have only the content onto the top. Hmm

  3. sonichtml

    sofa!Worth a try

  4. Yuri Goytacaz

    How about web semantics? Do you think #sidecol is alright? And if the “sidecol” wont be placed in the SIDE but in the bottom of the layout?

  5. Scott

    Great post. I recently considered giving this technique a shot. It’s interesting to hear that it has been beneficial in your testing. I wasn’t sure if it would be even though I had my suspicions.

    A thought regarding accessibility: Mark Pilgrim’s Dive Into Accessibility from 2002 recommends this technique as more accessible and suggests that if you can’t implement it, you should use a “skip-to-content link.” In your instance, maybe a skip-to-navigation link in the beginning of the source would be beneficial for screen reader users and those who navigate by keyboard.

    Finally, if you add a top margin to the side column and make the wrapper div self-clearing you can eliminate the absolute positioning on everything but the header, making a traditional floated layout work for everything else, eliminating the min-height hack. Of course that’s just trading one set of hacks for another, and it comes down to personal preference. :-)

  6. Soh

    @yuri – the semantic police will come arrest you, and may leave you in jail for 2 months.

    @Jitendra & Scott, great suggestions! I never though of that, and will def be looking into it :-) Thanks!

  7. Chris Casarez

    Krishna,

    This technique is not about having only the content at the top. You can use this to put whatever you want at the top, but in this case, we’re using the content as an example. In any case, it’s good SEO to have your keywords early in your mark up, especially if your page is code-heavy.

  8. The Producer

    Interesting, but I always was told that you should have your markup in the order it appears, for those moments when the css is not used or displayed at all. I would be interested in hearing your thoughts on this, is it still necessary?

  9. Soh

    @theProducer Correct, In most cases the markup should be natural. Again, this is not recommended for all sites out there, I would only recommend it to those who have heavy markup that is weighing the page down before any real unique content is visible~ :-)

  10. E11World

    Interesting technique. I kind of had this idea before too but never really bothered to try and test it. Thanks for saving me the time. I will give this a try sometime soon I hope.
    Just wondering, if I had a lot of includes (the include page is between 4kb-9kb). Would that effect the search engines crawling the page? They would see all the includes and header information before the content which might be 50 lines sometimes (some js scripts for example)?

  11. Isko

    I thought that both keyword density and markup hierarchy were both debunked for not having any SEO advantages?

    Did a quick trip to Google and Matt Cutts (of Google) says KWD is not a factor, focus more on the text itself. And I think the markup hierarchy is only a factor if you have an enormous amount of code and you go over the maximum indexed page size (around 1mb).

    Personally I would spend my time on things that are proven to work.

  12. Chris Casarez

    E11World – it depends what’s on the include. If you’re pulling content that shows up as client-side, then expect the SE bots to have to read it. Simply do a view source on the browser side of the page you’ll see what the SE spiders see.

    Isko – I thought so too at one point, as I have read/listened to several SEOs claim it doesn’t do any good, and offer their own anecdotal evidence for such. Unfortunately it usually comes in the form of “I don’t bother with KW density, and I do ok…” This isn’t a very scientific way to approach the matter.

    In any case, Soh and I have tested this on several websites and it clearly matters. The difference is, it matters more on less competitive sites (with lower pagerank and less links pointing to them).

    This is what Matt Cutts says about KW density: in the on-page space, I’d recommend thinking more about words and variants (the “long-tail”) and thinking less about keyword density or repeating phrases.

    He’s not saying it doesn’t help, he’s saying it helps more to think about KW variants. As for having your text early on the page, Matt Cutts does say this helps “a little bit” 1:02:20 into this video.

    http://www.seoracle.com/seo-tutorial-optimization/matt-cutts-seo-tips-for-bloggers-place-keywords

  13. Rory Martin

    Very interesting, so for better search engine optimisation this will perform more successfully than the standard website order? It makes sense really for each unique page, however I often have problems with absolute positioning across different browsers. But I’ll work on it….
    Thanks for the knowledge.

  14. Chris Coyier

    Hey Soh, Great minds think alike! I literally just posted about this, but you beat me by a few days and did a better job =)

    The reason it came up for me is just what you mention in the opening paragraphs. I was working with an eCommerce site with an enormous header area and sometimes not much in the way of content on it’s products. I wanted to see if I could do whatever I could to make sure that precious little content was given as much prominence as it could get in the markup.

    Hopefully this will work!

  15. Soh

    Sup Chris! I know exactly what you mean, remember when Toby Pitman and I came up with the same idea of the js/css clock? haha great minds do think alike, absolutely.

    That’s exactly what we had in mind as well, we were concerned by our massive navigation, massive select options, inline javascript, etc that appeared before our content~

    Going to check out your article now, thanks for stopping by :-)

  16. Brian

    I’ve used this method only once in a personal site, only because visually it’s the same final product. But structurally it’s something new compared to other sites out there. I Just read Chris Coyier’s Article and I have to say that this methodology can’t hurt to work into a site that needs this attention. I.E. “Content Rich Client Sites”

    Thanks for this information

  17. Bogdan Pop

    @The Producer. Well, you can add a simple div that has links to navigation areas and so on. You style it via CSS to hide it from the viewers eyes, but if css styling is gone, it pops up right on top of the page.

    You would get rid of the 150 lines of navigation Chris talks about on CSS Tricks, and get instead a few lines of code. I think that even one would do, but in any case, 5 should be enough.

    I guess you could even put that div in there with javascript, and then crawlers won’t even see it at all.

  18. E11World

    Thanks for the feedback Chris. I check the source and I had about 250 lines of code before the actual content (I knew this already though) and I can’t take out much of the includes. Maybe minimize it to 150 lines at the most but still, spiders might not get deep enough to get to the content.

  19. Ahmad Alfy

    Great technique I will definitly be using it in the future.

  20. ant

    It’s not semantic though, what happen when someone visit your site using screen reader.?

  21. Soh

    Hey ant, please read the notes regarding the semantic/accessibility issues :-) It’s been covered already.

  22. allanwang

    I ain’t like that, to write too many code of css. But SEO…

  23. Gwóźdź web designer

    This is interesting and possible. I have one site to do with content. I think I am gonna try it. Why not… Lets try it…

  24. Bruce Li

    Over the last 4 years I’ve done almost 2 dozen real estate sites for 1 tiny yet popular caribbean island. The last 5 used this technique. I honestly see no benefit. The companies who actively respond to inquiries from their site’s visitors, update their site daily, and whenever possible try to get their url mentioned in maganies and newspapers on top of traditional advertising…those are the ones who are at the top for the most desired search terms.

  25. Bruce Li

    Although I agree about it being a good idea for e-commerce sites with massive amounts of markup preceding the important content.

  26. Jean-Marc

    Although a very interesting website that I bookmarked, I find it amusing when I look at your source to see that the header comes first, then the content, followed by the right column and ending with the footer. I guess WordPress hasn’t read your blog yet.

    As ironic as it is, it still is a good post.

  27. Soh

    Hey Jean,
    If you read the article, I specifically mention that this technique is more suited for sites with heavy markup (E-Commerce site with heavy navigation for example), and not recommended for all sites.

    As you can see, cutting markup on my site would not be that much of a benefit since its not that heavy to begin with ;-)

    Thanks for stopping by :-)

  28. Ricky

    This is very informational article. I always believed that tables in the web page do not help the website much and to replace tables, div tags are very effective. And the mark up hierarchy you mentioned above also looks result oriented. I do use this hierarchy on my website right now.

  29. feha

    Hi
    great article …
    you can have just one link at the top as someone mentioned here …

    jump to navigation and this will work for screen readers to …
    many crawlers will skip the page if it takes too long to load …

  30. Barton

    Great article again.

    Can this template be adapted for a 100% fluid 2 column layout?

    Regards,

    Barton.

  31. Danish Backer

    Thanks a lot Dude!
    Very very Nice…. info.

  32. xaby

    haha didnt think of putting the content (source) before the header. you sure have some good seo stuff here.

  33. jitendra vyas

    How screen reader will read this page according to css position or according to position of content in source code?

  34. web design kent

    Great read for the beginners to the SEO world!

  35. Peter

    Can you take a look at my site? I am thinking of implementing your idea, but not sure whether my header is heavy or not …

    What is your opinion?

  36. Diwa

    Interesting tip. I’ll use this on my next projects. Thanks for sharing.

  37. Avangelist

    I would be curious to see this done again now that the new Google alogorithm is in, which is more about hierarchy than before, or so I understand it.

    The semantics of the markup it seems is now just as important as the content itself.

  38. Enrico

    Ehi Soh! Great post here! Can I translate it in italian on my blog?

  39. Soh

    Sure thing! Please just be sure to reference and cite the original article :-)

  40. Enrico

    Of course I’ll do. Great! Thank you so much Soh, I’m going to publish :)

  41. Liverpool Builders

    great post, I think this technique will be great to web designers and seo coders, thanks

  42. Muge

    Very good article for beginners like me:) Thank you so much Soh!

  43. Justin O'Neill

    y0 guys!, i know Soh was talking about ecommerce websites and websites with heavy code.., I’m in the process of creating a forum. Think I might be implementing this technique and see what happends! Sick post!

  44. supaslaom

    Never, never touch the logical hierarchy of structure of your document in order to be liked by search engines… you end up with queer mark up only to follow a temporary algorithm… no one knows when, if or why Google or Bimg might change their analysis of web contents …

    Beware: HTML5 will bring new semantics to web documents. there is no need to things like they are described here.

    Also, do not ignore accessibility. read into blogs and learn how difficult it is for handicaped persons to navigate through badly structured content.

    Please learn: as simple an robust as possible.
    We should go on making websites that are minimal and basically coded according to logic structures and the semantic expressions we have.

    there aint no better way to please users of any kind and search engines as well …

    supaslalom

Speak Your Mind...

Post HTMLNeed to Post HTML Code? Use Postable to post code friendly html. *Wrap all html code in <pre></pre> tags.
Post HTMLNeed to Keep Updated with Comments? Subscribe to comments now.

CSS Gallery