Document Structure vs. Document Appearance, the Power of CSS

I'm only telling you because I believe in honesty, actually that's a lie too

Welcome to my blog, please feel free to subscribe to my RSS feed, join me on Twitter or leave a comment.

I’m only telling you because I believe in honesty, actually that’s a lie too … I’m only telling you because I want to … that’s the truth.

When you look at my home page, all the articles appear to be the same but they’re not. One of them is special and both Google and I know it’s special but you don’t because I’ve purposely altered the appearance of the article title to look like the others in the list. It’s a simple trick with massive Search Engine Optimization benefits but very few people do it.

On my home page, I load the most recent posts and display the title along with an excerpt for each just like most websites but what I do is a little different … I wrap the first story in an <h1> tag and the rest in <h2> tags. For those of you who don’t know much about document heirarcy I wrote a whole piece on document structure in Dreamweaver a while back but I’ll explain the basics for you here. A document can have only one main heading tag, it’s the most important thing on the page. Most people would assume that my name is the most important thing on the home page since it’s the biggest and it’s at the top but that would be fairly narcissistic don’t you think?

No, the most important thing on the page is the title of the article I want you to look at. In all my sub pages, the most important thing is the title of the page, which I them wrap in an anchor tag to ensure Google understands just how important it is. For example:

<h1><a href=”http://www.thisismyurl.com/tutorials/placing-page-content-in-adobe-dreamweaver/” rel=”bookmark” title=”Permanent Link to Placing page content in Adobe Dreamweaver”>Placing page content in Adobe Dreamweaver</a></h1>

Note that it’s in the <h1> tag, which tells Google that it’s REALLY, REALLY important … in fact, it’s the most important element on the page. Way, way more important than my name which is a rather paltry <strong>  tag:

<strong><a title=”Building global business with dynamic results.” href=”http://www.thisismyurl.com/”>Christopher Ross</a></strong>

Sure, my name looks important for branding purposes but when Google and other robots index my page, they see past the name and go right to the meat of the page … my <h1> tag which represents what the page is actually about. What then, to do on the home page? After all, I still want to tell the search engine robots what is important on my website but I can’t very well tell it all my titles are equally important and equally the top …

This is where I have to admit that I’ve told a small fib. Barely worth mentioning but a tiny fib all the same, my first story in the list of home page stories is always wrapped in an <h1> story which tells Google it’s the main heading for the page while all the rest on the page are wrapped in <h2> tags which tells Google they’re still important but not nearly as important as the first.

Sure, it’s more important from a document heirarchy point of view but I don’t want the first story jumping off the page visually, so I don’t want to make it bigger or bolder than the rest of them, which is where the trick comes in. Luckily it’s an easy fix using Cascading Style Sheets:

#homepagecontent h1,h2 {
     font-size: 24px;
     line-height: 30px;
     margin: 0px;
     padding: 0px;
     text-align: left;
}

#homepagecontent h1 a,h2 a {
     color: #123456;
     text-decoration: none;
     font-weight: normal;
}

#homepagecontent h1 a:hover,h2 a:hover {
     color: #cccccc;
     border-bottom: dotted 1px #cccccc;
}

What you’re looking at is the CSS that I use for my home page, the #homepagecontent tells your web browser to only apply this on the home page, while the formating for the three states of activity (normal, anchor and anchor:hover. By defining both the h1 and the h2 CSS descriptions to be exactly the same, I’ve instructed the web browsers to make them appear to the visual eye identical.

Remember the purpose of a well structured document is to organize your document but that shouldn’t interfere with how you present that data to your audience.

Post Tags
Tags are used throughout a website to link similar content, click any of the keyword tags below to find similar content here on my website. , , ,

Technorati Tags
Technorati is a great way to find similar content, click the tags below to find other blogs on the web with similar content. marketing advice, search engine optimization, seo, web site design,

About the author
Christopher Ross - Christopher Ross is a technology evangelist living in Fredericton, Canada who travels the world preaching the benefits of technology to business professionals. When he's not writing or blogging about the future of the industry, he's busy building websites or helping businesses market themselves on the Internet.

2 Responses to “Document Structure vs. Document Appearance, the Power of CSS”

Comments

You're welcome to leave a comment using the form below.

  1. Mike Collins on December 03, 2008 at 11:29 am

    Wow, that’s really clever. Most themes I’ve seen wrap the Blog Title in H1 tags by default. That’s probably fine for a home page if your title is the keyword phrase you’re targeting, but for individual posts using H1 on the Post Title makes a lot more sense in terms of SEo. Thanks for the tip!

Pingbacks

Here's a list of web sites linking to this article. Would you like to be listed here? Link to my articles in your next post.

  1. What is the most important part of your web page? :: Christopher Ross on December 03, 2008 at 12:24 pm

Leave a Reply

Please note: I've recently introduced a new policy on my website and welcome comments, including dofollow rules but I require all posters to use their real names (not keywords). Your comments are always welcome, keyword spam will be deleted immediately.

CommentLuv Enabled

Sponsors