• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

CSS Problem Zen Drupal


#1
Hi Guys,

Don't know if you can help. I am currently themeing a Drupal site and have used the zen theme to start right back to basics. I am trying to style are certain list item which has a class but I cannot seem to get anything to work Any idea's? Please see the image of where the list item is nested.

http://www.glenwheeler.co.uk/web-box/style.png

what would the css be for this? I have tried alsorts, the latest one being

#navigation #main-menu ul li.menu-121 last {
background: yellow;
}

I'm doing something wrong... :/

Cheers ladies n gents!
 

Harry

Senior Member
#2
Just use .last, you don't need all the #navigation #main-menu ul li.menu-121 as well, that's making your CSS far too specific.
 
#3
i know dude, but I dunno if that will work, ill try...

EDIT: Just tried it and it won't work with just the .last, I have the same issue with my personal site too with this silly nesting That these CMS's do. Grrrr!!
 

Harry

Senior Member
#6
Okay what I think needs doing is a CSS rewrite. If you've got CSS full of #id #id .class element .class{ style:info; } then it really is too verbose.

All you really need to style that nav is:

Code:
#main-menu{}#main-menu li{}#main-menu a{}#main-menu .last{}
 
#7
Yeah your right dude, however I was just trying to use the themes code it seems I ight have to do a lot of re writing for it as there's a lot like this. Am finding this first Drupal project of mine a bit of a pain. Cheers for the help Harry.