...

View Full Version : CSS Links not working!



the-dream
05-17-2007, 04:18 PM
My link styles are not working.

Here is my HTML:

<div class="navlink"><a href="index.php" class="navlink">Base</a> <a href="edit.php" class="navlink">Edit</a></div>

Here is my CSS:

.navlink {
height: 20px;
width: 100%;
background-image: url(../images/nav_bg.jpg);
text-align: center;
text-decoration: none;
}

a.navlink {
height: 20px;
width: 100px;
background-image: url(../images/nav_bg.jpg);
text-align: center;
text-decoration: none;
}

a.navlink:hover {
height: 20px;
width: 100px;
background-image: url(../images/nav_bg_over.jpg);
text-align: center;
text-decoration: none;
}

a.navlink:active {
height: 20px;
width: 100px;
background-image: url(../nav_bg.jpg);
text-align: center;
text-decoration: none;
}

a.navlink:visited {
height: 20px;
width: 100px;
background-image: url(../images/nav_bg.jpg);
text-align: center;
text-decoration: none;
}

kewlceo
05-17-2007, 04:23 PM
Is your style sheet in a folder such as "css"? If your style sheet is in the same directory as your HTML file (or embedded) then remove "../" in the URLs.

the-dream
05-17-2007, 04:27 PM
Here is the folder stucture!

/index.html
/images/(image name)
/css/menu.css


on my index.html page i have:

<link href="css/menu.css" rel="stylesheet" type="text/css" />


to link the CSS sheet

marian26
05-17-2007, 04:40 PM
Then change url to (images/image.jpg)

kewlceo
05-17-2007, 04:44 PM
The URLs seem fine, just checking. :)

So, with that code then there would be a background of "nav_bg.jpg" behind all the links, and "nav_bg_over.jpg" just over hovered links. Is that what you're shooting for?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum