Sekedar coretan seorang nyubi
CSS and SEO can explode your earning power
Why CSS is a GREAT SEO Tool
When you ask somebody about CSS in general you will get one of two replies. There is the ‘Oh I cant be bothered, tables work fine for me’ crowd and the ‘Gosh yes you can do so much more in CSS’ brigade.
Rarely, if ever, will you get the response ‘CSS is so much better for SEO’ and if you do it will be from somebody who thinks it is because having a remote CSS file lets you have shorter HTML files.
Well that is only a tiny part of the CSS story. I am going to show you how to get REALLY down and dirty with CSS and SEO plus some nifty javascript! Please Note:It is almost impossible on this site to show you working code hence all the [replaced] bits. This is good for their security but bad for us! So please visit the page at the bottom to see this code in action, and you can cut and paste from there as well. To see the css and javascript files just look at the page source for their names and replace the /xxxxxx.php with .xxxxxx.css in your browser.
The key things that let you tweak the on page SEO design that CSS can help you with are a well guarded secret of a few webmasters and SEO experts. I expose most of them here, enough so that you can design a well optimised site and STILL have it looking good to your surfers.
The least useful is header redefinition. In particular the H1 tag. Now you should only use H1 once or maybe twice on a page. Most people dont use it at all though. Why? Because it looks Horrible! Who wants that in the middle of their page? By using a simple statement in your CSS file such as:
h1 {color:fuchsia; font-size:15px font-family:”Times New Roman” serif;}
You can reset the color, size and even font of your H1 tags. You can even make them invisible in your other text if you want. Same goes for H2 (3-5 per page). In this way you can set your most important keywords as headers which is very good for SEO, while keeping your content looking great.
A killer application for CSS though is content repositioning. When the search engine ‘looks’ at your page it reads it in sequence as a text file. Things near the top of the text file score highly, things at the end score lower. Unfortunately a paragraph you want to score highly is usually positioned midway, or even at the end of the page. At the top is usually some info about the site and how to use it, or a news section, or your latest blog/twitter posts etc.etc.
By using content containers (called div) and some CSS you can reposition the content where you want it. This applies EVEN if you are using an old style table layout. Here is how: In your HTML file have a div right at the top of the body section – first thing the search engine sees after the title. Like:
CSS and SEO
Css and seo secrets explained by Malcolm Grandis.
Malcolm explains CSS and seo secrets and shows you how to
practically apply CSS and SEO to drive your websites success.
Rest of your site here… ……….. …….
So you now have the really awful looking paragraph or two thats great for SEO right at the top. Now lets move it!
In your CSS file or a style statement write
#top {position:absolute; top:800px; left:120px; width:400px }
So when the page renders the browser will place the div contents exactly 800 pixels down the page, 120 pixels from the left edge and make sure its only 400 pixels wide. Of course if you are really sneaky you could put it as left:-500px and it dissapears off the left edge of the page but this has been known to crash some older browsers.
Now for the really hot use of javascript and that is content swapping. Place a div coded similarly at the top of the page, where you know you really want some different content. Now make a javascript file, called say ‘myscript.js’ containing this:
function change(){
var html=document.getElementById(“top”);
html=’<strong>here is all my new content that is much better for the surfer but not so good+ for SEO</strong>’;
}
And add the javascript file to your page head section and immediately under your target div call the function in the script you wrote like this:
change();
Rest of your page ……
A word of caution: if you do this a lot G00gle call it cl0ak1ng which is not good. If you are paranoid run your javascript file though an obfuscator (search for javascript obfuscator) which will remove the plaintext element from it so the search bot cannot read it. Personally I dont bother and have never had problems.
The next trick is with javascript and links. It is not good for SEO to have too many links especially from your index page that go off site, however you may want a lot to other sites depending on what sort of sites you have. If you put a table of links in Javascript then the search engines cannot see them.
Religious Ebook Links
Then whenever you write:
links();
your links appear, and the search engines know nothing about them. Of course do not do this with reciprocal or one way links you have arranged with other webmasters as they will not appreciate it! Its good for linking to off page references and sponsors though.
Now for my final word on CSS and Javascript. You can physically move content if a user clicks on a link or an image, or even if they just hover the mouse over an image. In fact this is a VERY good excuse to have a HUGE amount of content on the page that the search engines will index but the surfers will never see unless they look for it hard. The joy of this method is that you can never be accused of cl0ak1ng. Using the same div as before let us pretend that you have 5kb of ugly text stuffed with keywords and links with keywords as clickable text pointing deep into your site. We define it in CSS as below and make it invisible (then it can never be seen when loading) and give it a z-index so if it appears it will never mess up your page layout…
#top{position:absolute; width:600; top:400; left:220; background:white; visibility:hidden; z-index:2;}
#main{position:absolute; top:40; left:0;z-index:1; }
Put div tags with an id of main around the rest of your page content.
In your javascript file add:
function showtop(){
document.getElementById(“top”).style.visibility=’visible’;
}
function hidetop(){
document.getElementById(“top”).style.visibility=’hidden’;
}
Finally in the bottom left corner of your page put a little link like this:
If the surfer hovers his mouse over the tiny asterisk at the bottom left then the div will appear and when his mouse leaves it vanishes… guess what? It will never happen. But its enough so that any complaint about cloaking will never stick. Sorta bending but not breaking the rules.
Here endeth the first lesson! There is a demopage at ebook-a.com you can look at to see this technique in action.
Malcolm Grandis
Written by Mattinblack
Recent Comments