Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Good code, bad position? 1

Status
Not open for further replies.

makemusic

Programmer
Apr 3, 2004
43
Hi

I am concerned that my initial log files were showing individual sessions of 100+ a day that have now dropped to around 30 a day, and I've seen no movement in google when using key phrases.

I believe my code is pretty strong, having coded it all from scratch (bar the JS and Flash), with most of it CSS, and I've followed the basic rules for good optimising....at least I thought I had.

However a search for my website name only pulls up 2 pages worth (all results being chat forums I've visited) and a search for the key phrase "sailing log" sees me in at around 250 on Google. There are far worse sites that appear to be badly optimised who appear well above me.

I'd just appreciate a few comments on my code and if you could tell me that my non-movement boils down to a lack of links pointing to my site.

The site was launched in Feb/March and is called
 
Maybe it's choking on the fact that none of your pages appear to have an opening [tt]<html>[/tt] tag? It also might be confused by the way you've started all the links in your menu with "..", even if you're at the home page. Write your internal addresses like this, to get them relative to the root of the site regardless of what page you're on:
Code:
<a href="/log/log-home.asp" class="menulink">&nbsp;log</a>

Actually, the whole way you've coded the menu is a bit long-winded, but that shouldn't bother the spiders.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Too soon to tell. When it's been up 6 months and has been in and out of the serps a few times then start looking.

Forum links and "run of site" links appear to have been devalued somewhat Googles February update so you will need some decent directory links as well before you see a lot of movement, up or down.




Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Maybe it's choking on the fact that none of your pages appear to have an opening <html> tag"

Could I get more embarrassed? I think it's one of those things where I've been looking at the code for so long I miss something as obvious as that!

Two comments you made though Chris I'd like to discuss:

"the whole way you've coded the menu is a bit long-winded" - how do I shorten them? Can they be any shorter? I don't see how.

"you will need some decent directory links" - not sure I understand what you mean by this.
 
Two comments, two Chrisses!

I'll tackle mine...

You've built your menu from a series of <a>s within <div>s within <div>s, each with its own class and some inline CSS (and a [tt]&nbsp;[/tt] to push the text across):
Code:
<div id="menu">
<div id="menubutton" style="left: 0; top: 0;"><a href="../home/home.asp" class="menulink">&nbsp;home</a></div>
<div id="menubutton" style="left: 0; top: 4;"><a href="../log/log-home.asp" class="menulink">&nbsp;log</a></div>
 ... etc ...
</div>
There's a lot of stuff you don't need there -
[ul]
[li]Once you've identified the outermost <div> with a class, you shouldn't need to identify the elements below it. Just use more sophisticated CSS selectors.
[/li]
[li]Rather than use relative positioning and all those [tt]left[/tt] and [tt]top[/tt] rules just to space your blocks out by four pixels, just use a [tt]margin[/tt].
[/li]
[li]You can use padding to shift the text across, instead of adding in all those [tt]&nbsp;[/tt]s.[/li]
[/ul]
Here's how you could recode the menu (I'm using a <ul> instead of <div>s as it looks better to anyone with CSS disabled):
Code:
<ul id="menu">
<li><a href="/home/home.asp">home</a></li>
<li><a href="/log/log-home.asp">log</a></li>
 ... etc ...
</ul>
Much cleaner, eh? Here's how you style it:
Code:
#menu {
   position: absolute;
   top: 78px;
   left: 6px;
   width: 100px;
   overflow-y:hidden;
   overflow-x:hidden;
   z-index: 1;
   list-style: none;  /* suppress list bullets ... */
   margin:0;
   padding:0;
}

#menu li {
   list-style: none; /* but some browsers like it here */
   margin: 0 0 4px;  /* bottom margin instead of positioning */
}

#menu li a {
   display: block;
   width: 80px;
   background-color: #D0B8DA;
   color: #5A445E;
   text-decoration: none;
   border: thin solid #5A445E;
   overflow-y:hidden;
   overflow-x:hidden;
   font-family: Arial, "Times New Roman", Times, serif;
   font-size: 12px;
   font-weight: bold;
   padding-left: 5px;  /* instead of the &nbsps */
}

#menu li a:hover {
   color: white;
}
Making the <a>s [tt]display:block[/tt] makes the whole menu button clickable (you might want to change its colour on hover), otherwise it works the same as your existing code.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Wow. That's fantastic, Chris! I can't make big changes just yet (work pc in turkey, me currently in uk) but I'm saving this page. Thank you for your time.

BTW - just been to your site. Very clean and quick to load. Like it.
 
Thanks.

Incidentally, since you're absolutely positioning it, you can put that menu <ul> (almost) anywhere in the <body> of your HTML files. You'll get a slight SEO advantage if you put it after the main content of the page, as engines (allegedly) give more weight to text near the beginning of the file than the end.

I'd put it after the end of your <div id="content">, so the first thing the spiders read is the <h1>, followed by the <h2>, followed by the page contents, with the menu coming last.

PS. Just been looking at the photo gallery on your site, some real beauties in there!

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Yes, I did wonder about that. In fact I had tried to move my menu further down on the previous build of the site, but I think I was getting my absolutes and relatives muddled up because they didn't position correctly. I'll attempt it again.

Annoyingly I can only make minor changes at the moment because my local version of the site is on my laptop in Turkey. Grrrr!

Photographs - plenty more to come! Thanks, Chris.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top