7 replies [Last post]
neongamer
Offline
newbie
Last seen: 12 years 6 weeks ago
Timezone: GMT+1
Joined: 2008-08-08
Posts: 3
Points: 0

Hey guys, I'm setting up a website for my virtual airline, and when trying to set up my link bar across the top I added the following to my style.css:

a.left:link {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #B00000}
a.left:visited {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #B00000}
a.left:active {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000}
a.left:hover {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000;}

but for some reason the link still shows up in that irritating normal blue colour :curse:. I ran the code through W3C and got this:
Parse Error --> a.left:link {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #B00000}
I've seen many stylesheets that use this exact code but it won't work for me. I was hoping W3C's validator would give me a heads up on how to fix it but it didn't. Can you please?

Additional info:
Doctype is HTML, URL is http://pacificexpress.freehostia.com/

Megalith
Offline
newbie
Netherlands
Last seen: 12 years 16 weeks ago
Netherlands
Timezone: GMT+2
Joined: 2008-08-08
Posts: 2
Points: 0

missing something there...

a.left:link {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #B00000}
a.left:visited {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #B00000}
a.left:active {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000}
a.left:hover {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000;}

I see something missing in a few of those lines, it should be:
a.left:link {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #B00000;}
a.left:visited {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #B00000;}
a.left:active {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000;}
a.left:hover {text-decoration: none; font-family: Verdana,Arial,Helvetica,sans-serif; color: #000000;}

That semi-colon was missing in a few lines.
Not certain if that is the big fix as I only took a real quick look at your site and css for this part, but it's something I've seen wrong with many sites, including some of the ones I've had in the past.

dragons_own
Offline
newbie
Sheridan AR
Last seen: 12 years 16 weeks ago
Sheridan AR
Joined: 2008-08-08
Posts: 3
Points: 0

Suggestion

CSS:
a.left:link {
text-decoration: none;
font-family: Verdana,Arial,Helvetica,sans-serif; 
color: #B00000;
}
a.left:visited {
text-decoration: none; 
font-family: Verdana,Arial,Helvetica,sans-serif; 
color: #B00000;
}
a.left:active {
text-decoration: none;
font-family: Verdana,Arial,Helvetica,sans-serif; 
color: #000000;
}
a.left:hover {text-decoration: none; 
font-family: Verdana,Arial,Helvetica,sans-serif; 
color: #000000;
}
/* I Put this in for your decoration...i couldn't 
figure out where you had linked the two together...i
 dont understand the "left" you used...I could just be
 stupid to your methods but *shrugs* HOPE THIS HELPS!! */
 
.linksleft{
	text-decoration: none;
	font-family: Verdana,Arial,Helvetica,sans-serif; 
	color: #B00000;
}

Hope this helps!!! I added comments where i altered the code,
it worked when i copied your XHTML from your site and took that css and put it together.
GOOD LUCK!

-JeSs-

dragons_own
Offline
newbie
Sheridan AR
Last seen: 12 years 16 weeks ago
Sheridan AR
Joined: 2008-08-08
Posts: 3
Points: 0

That could be a deal but

That could be a deal but usually if it's the last attribute it doesn't matter. *shrugs* Could be the cause though.

-JeSs-

Megalith
Offline
newbie
Netherlands
Last seen: 12 years 16 weeks ago
Netherlands
Timezone: GMT+2
Joined: 2008-08-08
Posts: 2
Points: 0

Well, it has been the cause

Well, it has been the cause with a lot of sites I've seen.
And it isn't the last attribute in which it's missing, it's in a few before the last one, the first of which being where W3C got stuck.
And in some browsers, it can make a great difference between a working site and a site that doesn't load, even if it's "just css".

I just took a second look at that site and I'm seeing some other things that have me puzzled.
Just below the body-tag I see a broken tag of which I don't know what it should be part of:
"http://www.w3.org/TR/html4/strict.dtd">
A bit further down I see this:
<td width="800" height="2" bgcolor="B00000"></td>
I know that td bgcolor can work without the #, but some not-quite-finished-but-still-pushed-into-the-open browsers will throw a little hissy-fit over it... those should be just a minority, I've only come across one about a year ago that went crazy on such things... just saying that there are some that have their own ideas on what is and what isn't html.
Those have nothing to do with the original question, just little things I've noticed.
I'm still fairly certain that the semi-colons in the css will get rid of W3C's parse error, and might even fix the issue itself of the links.

neongamer
Offline
newbie
Last seen: 12 years 6 weeks ago
Timezone: GMT+1
Joined: 2008-08-08
Posts: 3
Points: 0

I tried both methods still

I tried both methods still to no avail... Any further suggestions appreciated Smile?

downtap
downtap's picture
Offline
Enthusiast
Dallas, TX
Last seen: 5 years 45 weeks ago
Dallas, TX
Timezone: GMT-7
Joined: 2008-01-18
Posts: 227
Points: 36

Ok, I'm just going to

Ok, I'm just going to scratch the surface here, but I mean NO offense....but....
That markup is pretty bad. I would strongly, and I mean strongly suggest going through all the tutorials on HTML Dog and not rely on Frontpage to generate your pages for you.

Here's the solution to make your links work properly in that badly created file.
1. Remove the Links comment in your css.
2. Change the class that is referenced incorrectly in your link from 'linksleft' to just 'left'

neongamer
Offline
newbie
Last seen: 12 years 6 weeks ago
Timezone: GMT+1
Joined: 2008-08-08
Posts: 3
Points: 0

It's probably terrible, but

It's probably terrible, but it's been ages since I did this so... Yeah, go figure...

Anyway, I'm gonna slap [Solved] on this because I figured it out in the end (thanks to you guys). Thanks for all the help!