CSS The Add-On To HTML
Since it's early days, HTML has offered us many ways of altering the appearance of text. It's possible to create headings, bold text, text in italics and more. Using these tools, it easy to emphasize important words and ideas by making them stand out from the rest of the content.
Naturally, search engines have also noticed these features.
They know, as we do the headings and the bolded words.
The search engines have adjusted their algorithms to place more weight on a words that appears in the heading, or in bold, than to the one that just appears in the body text.
From a designers point of view the matter in which search engine algorithms work can be a problem. Search engines might like H1- sized headings, but many visitors consider them to be ugly. With this in mind, as long as the content of your pages has any effect on their ranking, there will always be conflict between what search engines and users want.
These issues are usually solved by cloaking the page.
Which enables the designer to show one design to search engines and another to humans. However, cloaking takes plenty of work and sometimes money. If only minor visual changes are required to please both parties, a simpler solution would seem sufficient.
CSS - Cascading Style Sheets
As the Internet got better HTML received an add-on called
Cascading Style Sheets. This new language opens the possibility of altering the visual representation of pages without the use of HTML. While search engines still do not understand CSS very well, nearly all browsers support it to some degree. TheCounter.com's statistics for March 2002 show that over 95% of their visitors use browsers with at least partial CSS support (IE3 or later, NN4 or later). This means that by using CSS, you can currently provide somewhat different-looking content to search engines and other visitors.
Although CCS doesn't offer the same flexibility and protection as clocking, it works great for making small design changes. Keeping in mind that most browsers understand CSS, most of them do support all of its features. To avoid unwanted surprises, it's better to check your pages in both NN4 and IE7. As more recent versions of these browsers have better CSS support, you're usually safe if your tricks work in the 7's.
What can you do with CSS tricks?
There are some "legal" things you can do with CSS. For example, you can use it to build your layout or to slightly adjust the size of your headings and body text. However, because loads of tutorials have already been written about those subjects, we won't be looking at them more closely.
Instead, we'll focus on the darker side of CSS tricks. Many search engines consider the techniques we're about to discuss to be spam, and may ban your site if you choose to use them. Using CSS to cheat the engines isn't safe - it's just somewhat safer than doing it with the traditional HTML method.
I do not use the tricks listed below, nor do I advise anyone to do so. However, they are included for informational purposes and for the pleasure of those who like to take risks. Just don't come crying to me when your site gets banned, because that is what's likely to happen sooner or later.
Hiding H1's, bold text and text in italics
As I already mentioned, a lot of search engines place additional weight to words that appear inside these tags.
Canceling the visual changes caused by the bold and italic tags is fairly uncomplicated.
A couple of different search engines take outbound links into account when they rank your page. For example, linking to a well-known page about soda and including the words "soda" in the link text could boost your ranking for those words.
Occasionally, it would be nice to get this advantage without encouraging visitors to leave the site. The solution is to use a bit of CSS to hide the link from human visitors. Because search engines don't see what is happening on the screen, they can't differentiate the hidden link from the normal links on your page.
Invisible Text In Many Ways
The oldest trick in the book is to place keyword-rich text on a page and then hide it from humans. In the past this was usually done by using the same color for the background and the text. However, search engines have figured this trick out long ago, so hiding text with HTML tags is definitely out of question. CSS makes it possible to add several new twists to the old trick.
With layers
The classic invisible text trick doesn't really hide anything. It just camouflages the text so that it doesn't stand out from the background. The more advanced solution is done by using layers by positioning them off the chart. Using this trick doesn't make the text disappear. It just positions the text to a place where users with graphical browsers that support CSS won't be able to see it. When using this trick, it's vital to remember that the negative values of "left" and "top" must exceed the positive values of "width" and "height". Simply put, "width: 132px; height: 85px" together with "left: -165px; top: -100px" is OK, "width: 132px; height: 85px" combined with "left: -100px; top: -75px" is not.
Invisible? You haven't seen anything yet
Of course, the ultimate way of hiding something is making it non-existent. One CSS property, display, provides us with the power to do just that.
The "display: none" instructs the browser to render the document as if the above HTML tag and its contents did not even exist. Naturally, "display: none" isn't limited to the P tag, it can be used with all other HTML elements as well.
If your thinking about starting some play with CSS tricks, it recommended that you only use external stylesheets that are linked from the HTML. Also, don't forget to create a robots.txt file that forbids spiders from grabbing the external CSS file. Although most spiders usually ignore external CSS files, some have on occasion requested them. It's way better to be safe than sorry.
|