Web Hosting Talk







View Full Version : CSS Help Needed


a1nerd
08-13-2005, 03:24 AM
My partner created a css file for navigation on the site. For some reason i can get the links to work. How do i add the links to this css file?

#linkList {
}

#linkListAdd {
position: absolute;
top: 10px;
left: 23px;

margin:0px;
padding-top: 5px;
}

#linkListAdd table {
display: block;
margin: 0px;
padding: 0px;

list-style: none;
}


#contentLinks {
padding: 0px;
margin: 0px;

width: 160px;
}

#nav {
list-style: none;

margin: 0px;
padding: 0px;

width: 160px;
}

#nav td {
margin: 0;
padding: 0;
list-style-type: none;
}


#nav a {
float: left;
padding-top: 23px;
overflow: hidden;
height: 0px !important;
height /**/:23px; /* for IE5/Win */
}

#nav a:hover {
background-position: 0 -23px;
}

#nav a:active, #nav a.selected {
background-position: 0 -23px;
}

#custompcs a {
width: 160px;
background: url("../images/button_custompcs.gif") top left no-repeat;
}


#prebuiltpc a {
width: 160px;
background: url("../images/button_prebuiltpc.gif") top left no-repeat;
}

#pchardware a {
width: 160px;
background: url("../images/button_pchardware.gif") top left no-repeat;
}

#webservices a {
width: 160px;
background: url("../images/button_services.gif") top left no-repeat;
}

#newestreleases a {
width: 160px;
background: url("../images/button_newestreleases.gif") top left no-repeat;
}

#upcomingreleases a {
width: 160px;
background: url("../images/button_upcomingreleases.gif") top left no-repeat;
}

#customersupport a {
width: 160px;
background: url("../images/button_customersupport.gif") top left no-repeat;
}

the_pm
08-13-2005, 03:46 AM
The links themselves are not added to the CSS file, they are added to your HTML file. The CSS simply controls how they look.

There are a number of things that could be preventing links from working in your HTML document. First of all, every single link style in that style sheet is a child element of an ID. This is not at all a bad thing (in fact, it's a good practice), but this means there must be containers around the navigation that have these IDs attributed to them. For example, if you have links pertaining to newest releases, according to your style sheet, there must be one big container with this id on it, probably something like this: <div id="newestreleases">[links and stuff]</div>

There's one thing to look for, proper containers in which your links should reside.

You could also have issues pertaining to where your background images are, looking at the paths you've shown.

If you have nested containers with various IDs, you could have style rules overriding each other. I'd ask your partner ;)