3 replies [Last post]
designz
Offline
newbie
Last seen: 15 years 13 weeks ago
Joined: 2006-06-25
Posts: 6
Points: 0

I have this page at www.klosterelev.dk/nyside

In the left column I have som links that are like I want them to be. BUT I would like som links in the main text (which is located in a div called spalte2 nested inside a div called main-content) but these links shouldn´t have the same properties as the other links on the page.

I tried to fix it by making this addition to the main-content div:

#main-content {
float:left;
width:525px;
position:relative;
top:0px;
left:13px;
padding-bottom:5px;
z-index: 4;
}

a.main-content, a.main-content:hover {
font-size:11px; font-style:italic;
}

But I guess its wrong, cause nothing happens.

How do I set the properties of textlinks only in this DIV ??

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 47 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

A simple descendant selector

A simple descendant selector group should work , I'm not sure what you're trying to do with the classes on the anchors. Classes are the same as ID from the point of view that they need to be specified on the element in question a.main-content doesn't seem to exist so wouldn't work. You could of course have tried it and run into specificity problems with an ID overriding your class selector.

Give this a try:
#spalte2 a:link {}

or if you need extra weight you could add #main-content into the mix as a top level ancestor.

On another note there are some much better approaches to dropdown menus that you should try 'Son of Suckerfish' and the menu generator on this site both utilise a more semantic use of ul li elements to construct links.

Hugo.

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

designz
Offline
newbie
Last seen: 15 years 13 weeks ago
Joined: 2006-06-25
Posts: 6
Points: 0

hmm

hmm thank you, but I cant make it work. I tried the following (perhaps I am doing wrong):

#main-content {
float:left;
width:525px;
position:relative;
top:0px;
left:13px;
padding-bottom:5px;
z-index: 4;
}

#main-content a:link {
font-size:11px;
text-decoration:underline;
}

and

#spalte2 {
float:left;
margin: 0px 15px 0px 0px;
width: 30%;
}

#spalte2 a:link {
font-size:11px;
text-decoration:underline;
}

designz
Offline
newbie
Last seen: 15 years 13 weeks ago
Joined: 2006-06-25
Posts: 6
Points: 0

works

Hey now it works. Thank you for your kind help!