Sublink CSS Not working (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


Avick -> Sublink CSS Not working (5/29/2004 10:21:12)

Hi Folks
I am having a bit of a problem with my links within a DIV tag

Here is my problem. I have a default link style as follows.

a:link {
font-weight: bold;
text-decoration: none;
color: #CC6633;
}

This is general link style for the site i am working on.

I then have a special link style within a DIV tag for a small menu at the top of the page.

div.topMenu {
text-align: right;
padding: 5px 2px;
width: 750px;
background-color: #ECECEC;
}
div.topMenu a {
color: #444444;
font-weight: normal;
}

Every time I place a link within the div with the .topMenu class it looks like the default link.

Im using Top Style pro to make the CSS and it looks fine their.
Im also using FP to make the page and it looks fine their also.
Its only when I view it in IE that the default style above appers.

It's probley a simple fix but I just can't see it.

Alan




c1sissy -> RE: Sublink CSS Not working (5/29/2004 10:40:22)

try adding another div to your code. like this,

div div.topMenu a, its called contextual or descendant selectors. You have an anchor within a class div of top menu, that is sitting within a div. (hope that makes sense) try this and see if it works for you.




Avick -> RE: Sublink CSS Not working (5/29/2004 10:45:27)

No Joy.
Tried it and and it had no effect. The only other way i got it working was to remove the default link and add the link styles as I go but I realy wanted to avoid this.

Alan




Avick -> RE: Sublink CSS Not working (5/29/2004 10:58:31)

Just tried it in Mozilla FireFox and it works fine.
The only thing is, The content is almost halfway down the page.

Alan




Giomanach -> RE: Sublink CSS Not working (5/29/2004 10:59:13)

I'm gonna edit your stylesheet to:

.topMenu {
text-align: right;
padding: 5px 2px;
width: 750px;
background-color: #ECECEC;
}
.topMenu a {
color: #444444;
font-weight: normal;
}

Try that and see what happens. Also, DIV layers prefer the ID attribute rather than class, which means you have to use a hash instead of full stop in your stylesheet

Dan




Avick -> RE: Sublink CSS Not working (5/29/2004 11:27:21)

Thanks Dan
Changes the CSS and transfered from Class to ID.
Works fine now.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875