Using XHTML/CSS for an Effective SEO Campaign

by Brandon Olejniczak

62 Reader Comments

Back to the Article
  1. I think many people who have replied here seem under the impression there is some kind of magic to SEO. I know people like Ammon have spent many years learning about Search Engines and various marketting techniques to really know them in great detail and be able to get as much out of them as possible. But the basic of SEO have been the same for a few years, good content with unfussy, well marked up code.

    The fact is many people don’t go along with web standards and don’t think to make the best of their text. The article is perfectly acceptable as it is, it is about how XHTML can help you with search engines, not specific tricks to get ahead of everyone else, its tricks that people like Google don’t like and why things like hiding H1 is a dodgy tactic. I contacted Doug Bowman about what I felt was a risky technique for search engines as far as the FIR trick was concerned for the simple fact that they don’t like hidden text!

    Yes following web standards can help with SEO, if your already following web standards then of course there wasn’t going to be anything new in the article, thats what it was all about! However, people who want to know more, or need convincing of the pros of using valid markup are more the kind of target audience of the article.

    For most of you who are well versed in CSS/XHTML already a simple line to say ‘Using XHTML in accordance with the W3C standards can help in getting a better rank in Search Engines’, but that wouldn’t really of made much of an article at all and wouldn’t have helped the people who needed the ‘how will it help’ type info. Its one thing doing it, its another to understand why you do it. Something I think the likes of Zeldman and Meyer generally do very well in looking at the ‘bigger picture’.

    Copy & paste the code below to embed this comment.
  2. When I converted my personal site over to Movable Type earlier this year I made a concerted attempt at setting everything in xhtml and css. I used many all of the techniques Brandon mentions in his article and my site’s Google click through rate has gone up at an unbelievable rate. Mind you one of the most popular searches is “Tights Gallery” – I have some pictures in my gallery of a Tie and Tights party we had – all very innocent but I suspect the visitors to those pages are somewhat disappointed!

    I have to agree that structural mark up is paramount and I still can’t believe how many sites ignore this!

    Copy & paste the code below to embed this comment.
  3. Brandon mentions the importance of having the title in the text, not just an image. However, having the author’s name in text is important as well. His only appears in the image. Nowhere in text searchable by a spider. He is invisible to the Web search engines.

    Copy & paste the code below to embed this comment.
  4. I really don’t know why you bothered. Not wishing to be egotistical but you really have a lot to learn about CSS. What you did using JavaScript can also be done using CSS and HTML.

    And I know you were merely explaning how to optimize a web page for the purpose of Search Engine Indexing, but come on, is it really necessary to waste time using JavaScript when a little experimentation with CSS and HTML will also do the trick? Articles like this are most often misleading and a complete waste of time for those in the know. If you wish to show us something, at least take the time to do it properly.

    Copy & paste the code below to embed this comment.
  5. If you are going to tout using CSS then please use correct CSS in your one and only bit of code. The correct property is FONT-SIZE not SIZE. The SIZE property controls the size and oreintation of a page (for printing). See http://www.w3.org/TR/REC-CSS2/page.html#propdef-size

    Copy & paste the code below to embed this comment.
  6. … to say about SEO?!

    Copy & paste the code below to embed this comment.
  7. And that was constructive HOW? If you’re gonna complain then at least keep it relevant…one could say “make the most of your text” in that regard.

    Copy & paste the code below to embed this comment.
  8. Ammon: thanks for your tips. But what do you think of my hidden logo and title in the http://www.via-israel.com ? I coded this since the logo is already embeded in the background image and I am lazy to positionate some transparant PNG logo with a javascript/activeX hack… Anyway the logo and title are hidden but not for pda/smartphones/lynx-like/NS4…

    Copy & paste the code below to embed this comment.
  9. Very little information. But maybe that’s all the information there is on this topic. If so, fair enough.

    I feel sorry for his Grandmother.

    Copy & paste the code below to embed this comment.
  10. This was way below the standard I’ve come to expect and enjoy from ALA stories in the past. ALA’s strapline is “for people who make websites”, right? Nothing covered in this article was in any way ‘extended technique’ for anyone who’s ever read an ALA story before.

    I don’t expect one of the three (?) main points of an ALA story to be ‘use heading tags’.

    Copy & paste the code below to embed this comment.
  11. I have just started a web site, www.zone4health.com, and am desperately looking for more cost-effective ways to get the name out there. For the novice, this was a brilliant article. You have my utmost appreciation!

    Copy & paste the code below to embed this comment.
  12. Jerome asked: “…what do you think of my hidden logo and title in the http://www.via-israel.com ? I coded this since the logo is already embeded in the background image and I am lazy to positionate some transparant PNG logo with a javascript/activeX hack… Anyway the logo and title are hidden but not for pda/smartphones/lynx-like/NS4… “

    Hi Jerome. I certainly understand your reasons, and the implementation is both practical and sensible. You do have a hidden H1 heading, but it repeats exactly what would otherwise be hidden from user-agents that do not support images. In other words, what you have is a cross-browser compatibility device rather than a method for hiding keywords.

    In fact, I commend you for not trying to take further advantage. It would be easy for many to think that if you were going to have a little hidden text anyway, legitimately, that adding in a couple of extra keywords wouldn’t hurt. Your honesty is your final and strongest protection.

    You see, even were some jealous competitor to personally report your hidden text to Google or any other search engine, I believe that the employee following up on that report would determine that there was no intention to decieve or ‘trick’ the spider, and so would reject the complaint immediately.

    What I’m saying is that the technique you have used has been used well and with honest intention. That makes a big difference in the final analysis.

    In fairness to all at ALA, I wish to ask that any further questions or requests for analysis be brought to the forums where I and others give advice freely, so that this discussion doesn’t get side-tracked into discussions of individual sites.

    Anyone wishing to ask about specific issues on their sites, rather than comment about the article and issue under discussion here, is most welcome to seek me out at http://www.cre8asiteforums.com/

    Copy & paste the code below to embed this comment.
  13. Dudes, you really need to learn to use CSS properly and update your web site. I used to be able to read “titchy small tiny fonts” like many of you egotists seem to prefer, but in the long run, the only thing that “titchy small tiny fonts” do to a person is to make them blind.

    Update your CSS to enable older bods with eyesight that is less than perfect (like meself) to be able to change the fonts to suit us.

    ROFLAO, watch em squirm as they scramble to find out how to achieve this. I bet they don’t update their web site to enable this feature.

    Copy & paste the code below to embed this comment.
  14. Because if you are going to do something, either do it to the best of your abilities, or don’t bother doing it.

    Copy & paste the code below to embed this comment.
  15. While these tips are good for optimizing the returned results of a search that hits your site [and there’s a lot to be said for that] I don’t really know how much this advice could help one’s actual search ranking. I don’t think there are any big engines anymore that actually use the page itself for ranking outside of keyword appearance.

    Having a legible summary on a search engine results page can be extremely valuable though.

    Copy & paste the code below to embed this comment.
  16. You’re giving away all the search engine optimisation secrets! Free! ;) Just kidding – it’s a really great article and I’ll be pointing my clients to it to help them understand the basics. Good one!

    Copy & paste the code below to embed this comment.
  17. Edward, when your using server side languages like PHP, the code, as I’m sure you know, is processed on the server before being exported as standard HTML to the browser.

    When an SE Bot requests a web page from a web server, the same process applies, the page is requested, the PHP engine processes it and outputs the product to the useragent.

    With the kind of example you posted above, I don’t think any SE will have problems crawling it as if it was any other static HTML page. You can get problems with certain areas of page dynamics, with things like variables being passed in the url for example. Its getting better, but there are things, well otuside the scope of this article, that can be done to make them more ‘Search Engine Friendly’. If you want more info on that kind of thing, I’d suggested following myself and Ammon to wwwcre8asiteforums.com where theres a few people more than willing to help. The article here was very specifically about XHTML and engines and how coding with standards can help. Anything outside that would be better discussed elsewhere I think!

    And DudeMan, I don’t think its especially hard to find articles on using relative font sizes instead of px to get user adjustable fonts. If your complaining, you could use a browser like Opera which has a full page zoom function that works whenever……

    ” if you are going to do something, either do it to the best of your abilities, or don’t bother doing it.”

    Isn’t always true in business, your best may take too long, use too many resources to make it viable. Over at www.accessifyforum.com its been discussed that maybe it would be better for people to be told if their site conforms to Bobby A or AA (within what the auto tests can handle) rather than just telling them what they need to do to make the site ‘prefect’. That would provide more encouragement to web designers not fully conversant with Accessibility to say that they have at least made an effort, rather than demanding they use an all or nothing approach to get any kind of recognition of it.

    Its always nice to aim for the best, but people also have to learn and businesses need to take ROI into account, can they justify the extra expense to make it ‘perfect’ when 85% ‘perfect’ may be good enough?

    Copy & paste the code below to embed this comment.
  18. Shame about the syntax errors. The deprecated font size attribute accepts a number or a percentage, it doesn’t take units. There is no size property in CSS, there’s a font-size property – but its a really bad idea to use pixels for it (http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html).

    Copy & paste the code below to embed this comment.
  19. Nice reading, (except for your granny, curious remark, that)
    though not groundbreaking news for web designers,
    as often to be found here.

    More often than not, seo-required H1 tags interfere with my layout needs
    so I get rid of it’s formatting entirely using margin, float and line-height.
    Demo at http://www.byteshift.de/tips/get-rid-of-h1-formatting

    Copy & paste the code below to embed this comment.
  20. I can’t see why it makes any difference to the search engine crawlers when they read a webpage, whether it starts with an <h1> right after the body tag. The thing is a computer right? What difference does it make to the computer if it is just looking for the <h1> tag? White space, garbage or script, what difference does it make as long as the computer recognises it isn’t <h1>?

    I can see there might be a content length limit, i.e. a couple of lines.

    See what I mean? That’s why it makes no sense to me to worry about having your logo JPG before your <h1> title. Or has google etc actually stated something along these lines?

    Copy & paste the code below to embed this comment.
  21. Thanks for the article. Other than the grandma comment, which was rude, the article was brief but helpful. I’ve been doing SEM for years but haven’t had the opportunity to build a pure CSS-driven site yet. I’m looking forward to it, and if I need a little ammunition to convince others that it’s worthwhile, this article may help a little bit.

    By the way, my grandmother at 81 is making lovely use of the web.

    Cheers,
    Gradiva

    Copy & paste the code below to embed this comment.
  22. Can’t believe you’d call your grandmother “dimwitted.” That’s just mean.

    Copy & paste the code below to embed this comment.
  23. It’s interesting that the article doesn’t mention the (X)HTML code structure itself. For example, with the magic of CSS, I can have a left menu that actually gets coded on the page /after/ the main content, so even though my menu is entirely text-based, contains H1 tags, etc, when google spiders my page, it’ll use the beginning text – which is actually content – as the small summary in its results.

    Example -> http://quotes.prolix.nu/

    This site uses a tweaked version of the blue robot CSS code. Good stuff.

    Copy & paste the code below to embed this comment.
  24. Hi, i’m new to CSS layout. After 6 years of mucking up HTML, i discovered this method really recently, after being struck by espn’s site.
    Not seeing any tables was a shock. This article gave me a lot of simple pieces of advice. I will source it when i try to convince the management to switch to CSS layout for our clients.

    Copy & paste the code below to embed this comment.
  25. let’s say i don’t want to use a h1 tag, just an image? is there a way so that i still reveive good search egine results? thx

    Copy & paste the code below to embed this comment.
  26. Another potential benefit for SEO of CSS design is the ability to position content in the hierarchy of the HTML in order to have the most important (keyword-rich) content at the top.

    Example: the chairman wants his 500-word mission statement appear at the top of the page, with product information below it. CSS-P saves the day by allowing us to position the content that the search engines require at the top of the HTML and yet display the chairman’s waffle at the top of the displayed content.

    Copy & paste the code below to embed this comment.
  27. After reading the article I thought that it is time to put it to the test. I proposed to my marketing team to implement across Europe and see what results we get. Will provide feedback on rankings in 1 months time.

    Copy & paste the code below to embed this comment.
  28. In general terms, I’d say that the article is right, but I think that any designer hoping that his/her rankings will get a boost only because of the code/content ratio is in for some nasty surprises. It’s really one of the ranking factors, but is not by far one of the most importants.

    And, of course, it’s not necessary for a web to be in XHTML+CSS to achieve that ratio, old HTML+CSS will do fine, but I agree, it’s good that these good practices gets rooted in he XHTML way of coding.

    Copy & paste the code below to embed this comment.
  29. You can get a good placement without using a h1, but images has nothing to do with your placement ;)

    Copy & paste the code below to embed this comment.
  30. You called your grandmother completely dimwitted—enough said!

    Copy & paste the code below to embed this comment.
  31. Googlebot happens to love well marked-up websites + Googlebot loves a good code to content ratio.

    XHTML / CSS offers you both.

    Copy & paste the code below to embed this comment.
  32. I honestly think that the amount of code does not matter as long as the site is quick loading, and has at least some amount of content to be indexed (or sufficient link popularity to not need to worry about on the page factors.)

    Copy & paste the code below to embed this comment.