5 replies [Last post]
k2k
k2k's picture
User offline. Last seen 3 years 1 week ago. Offline
newbie
Joined: 2009-01-23
Posts: 2
Points: 0

would anyone point out why my hover link won't work??? thanks.

css doc:

a.nav:link{color:#FFFFFF; text-decoration: none; }
a.nav:visited{color:#FFFFFF; text-decoration: none; }
a.nav:hover{color:#FFFFFF; text-decoration:underline; }
a.nav:active{color: white; }

html doc:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="css/text.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Xsoldier_Home</title>
</head>
 
<style type="text/css">
 
 
#wrapper
{
	position: absolute;
	width: 800px;
	height: 820px;
	top: 0px;
	left: 412px;
	border: solid;
	border-bottom: groove;
	background:url(image/xsoldierWallHome.jpg);
}
 
#menu
{
	position: absolute;
	width: 300px;
	height: 30px;
	top: 250px;
	left: 965px;
	border: none;
	background-color:none;
}
</style>
 
<body bgcolor="#333333">
 
	<div id="wrapper">
    </div>
 
    <div id="menu">
 
    <a href="http://www.yahoo.com" style="text-decoration:none"><b><font color="#FFFFFF">:: HENRY'S :: </font></b></a>
    <a href="http://www.msn.com" style="text-decoration: none"><b><font color="#FFFFFF">IT NOTE :: </font></b></a>
    <a href="http://www.msn.com" style="text-decoration: none"><b><font color="#FFFFFF">BLOG :: </font></b></a>
    </div>
</body>
</html>

skoizumi
skoizumi's picture
User offline. Last seen 1 year 33 weeks ago. Offline
rank Enthusiast
Enthusiast
Timezone: GMT-7
Joined: 2009-01-14
Posts: 74
Points: 3

<!DOCTYPE html PUBLIC

Xsoldier_Home

a:link{color:#FFFFFF; text-decoration: none; }
a:visited{color:#FFFFFF; text-decoration: none; }
a:hover{color:#FFFFFF; text-decoration:underline; }
a:active{color: white; }

Shinya Koizumi
--------------------
I work at kmishn.com
Web Development
Web Design

Hugo
Hugo's picture
User offline. Last seen 1 hour 51 min ago. Offline
rank Moderator
Moderator
Joined: 2004-06-06
Posts: 15095
Points: 2190

And where have you placed

:? And where have you placed the class .nav ?

Before you go too far with your markup please remove the bold and font tags neither are necessary, and font tags are simply not used any more period.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Deuce
Deuce's picture
User offline. Last seen 1 day 14 hours ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2005-11-20
Posts: 4416
Points: 1835

from what I can tell of your

from what I can tell of your markup is that none of your anchors have the class nav - so ya... either give your anchors the class nav or remove the class nav from your css.

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

k2k
k2k's picture
User offline. Last seen 3 years 1 week ago. Offline
newbie
Joined: 2009-01-23
Posts: 2
Points: 0

css file in separate text

I have a separate text document to hold my css code, i learned this from somewhere. (hopefully it is right)

in my css file: named "text.css"

a:link{color:#00CC00; text-decoration:none}
a:visit{color: white; text-decoration:none}
a:hover{background:#9966CC; color: white; text-decoration:underline}

and then i connected them by having this line of code inside the .. :
<link rel="stylesheet" type="text/css" href="css/text.css"/>

I also tried putting the

a:link{color:#00CC00; text-decoration:none}
a:visit{color: white; text-decoration:none}
a:hover{background:#9966CC; color: white; text-decoration:underline}

inside the .. didn't work.

I also tried:
<a class="nav" href="http://www.yahoo.com" style="text-decoration:none">:: HENRY'S :: </a>

// is the above the proper way? i thought so but it didn't work.
// the thing is, if you used dreamweaver, after you typed class=" the classes available will pop up, but my "nav" didn't pop up so i guess it is somehow not connected to the css sheet.

Would someone please give me a quick example? either putting the a:hover{.... } thing locally or externally... Thanks very much.

Deuce
Deuce's picture
User offline. Last seen 1 day 14 hours ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2005-11-20
Posts: 4416
Points: 1835

It's recommend that you get

It's recommend that you get the grips on the basics of HTML and CSS.
The HTMLDog.com tutorials are really well written and free!

all » http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph