rants from the dark side of marketing

Hiding content with CSS

Hiding content and stuffing keywords is an oldschool tecnique that has pretty much become obsolete. Search engines are getting smarter… and we find new tricks to game them. Remember the WordPress fiasco? They hid links to thousands of articles with CSS and they got busted. Moral is don’t be too blackhat with very popular sites.

If you don’t know a thing about CSS, start reading first.

Hiding content with CSS.

1. Display property

This one is quite simple. Here is the code:

CSS

#hidden {display:none;}

HTML

<div id="hidden">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</div>

This makes anything in your div invisible. You can also use other containers instead of divs, like <p>, <h1>, <table> etc. Read more about the display property.

2. Overflow property

This property defines what happens to the content that doesn’t fit inside its container. We are interested in two values of the overflow property, mainly hidden and maybe auto.

CSS

#hidden {
width: 100px;
height: 100px;
overflow: hidden;
}

HTML

<div id="hidden">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>

Example
(here is the css, style=”border:1px solid black; height:80px; width:300px; overflow:hidden;”)

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

If you use the auto property it will also have scrollbars so you can scroll for the rest of the content. Also experiment with the width/height of the div. You can make it 1px*1px or even 0px*0px.

If you are making Traffic Equalizer type sites, a good idea is to make a div with overflow:hidden and make it just as big to fit one scraped result. This way you are hiding content without looking too suspicious. Of course you can hide a whole book, keywords, links or anything else you want.

Read more about the overflow property.

3. Negative Margins

Margin properties define the spacing around each element. We can use big negative values for margins so we can push the content out of view. The margin properties we are interested in are: margin-top, margin-left, margin-right and margin-bottom.

If you just use something like <div style="margin-left:-9999px;"> Text I want to hide. </div> then you will get a horizontal scrollbar and it will be visible. Here comes our previous mentioned overflow:hidden. Because of the margin it’s certainly overflowing so we hide it this way.

CSS

#hidden {
margin-right:-9999px;
overflow:hidden;
}

HTML

<div id="hidden;">
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>

Ala WordPress

<div style="text-indent: -9000px; overflow: hidden;"> <p>Sponsored <a href="/articles/articles.xml">Articles</a> on <a href="/articles/credit.htm">Credit</a>, <a href="/articles/health-care.htm">Health</a>, <a href="/articles/insurance.htm">Insurance</a>, <a href="/articles/home-business.htm">Home Business</a>, <a href="/articles/home-buying.htm">Home Buying</a> and <a href="/articles/web-hosting.htm">Web Hosting</a> </p> </div>

This one uses text-indent instead of margin but works the same way.

Read more about the margin property.

——–

This sums it up for today. I hope this tutorial proves to be useful to you and helps you get better ads by stuffind enough keywords. I bear no responsibility if using any of the above brings in any damage to you or your sites. So, use at your own risk.

Posted on Thursday, September 8th, 2005 at 6:55 am under Rants. You can skip to the end and leave a response. Pinging is currently not allowed.

4 Comments

Darek Says:

Hi,

Since no one will leave you a comment spam. I volounteer.

You blog always has interesting information some of which I will try implementing hoping to improve my income.

Will let you know if i succed.

Long live Black Hat

Lauren Says:

Very cool CSS stuff. Considering I’m a CSS idiot, I’m only too happy to pick up pointers wherever I can…

So, when’s the next post? Huh? Huh? ;-) Miss them.

Roddy Says:

hi when is your next post dood i like the stuf you find would like some more keep it up

Darksat SEO Says:

I think I would use the negative margin instead of the hidden element.
and robots.txt the css file.

Leave a Reply

You must be logged in to post a comment.

 

Subscribe

RSS feed

Contact


Pages


Search


Asides

Content may be king, but distribution pays the king’s mortgage.

8/12/09» 15:51» link» comments

Google acquired reCaptcha about a month ago, you might want to throttle your reCaptcha solving per IP address from now on.

14/10/09» 16:22» link» comments

Matt Cutts on how Google deals with spam.

7/10/09» 14:31» link» comments

Why you don’t want to shard.

Real World Web: Performance & Scalability.

NGINX + PHP-FPM + APC.

Gearman is interesting.

31/08/09» 4:46» link» comments
 
 
Copyright 2008, blackhat-seo.com