homepage Welcome to WebmasterWorld Guest from 54.242.231.109
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
color tag not working
pathak




msg:3906300
 11:08 am on May 4, 2009 (gmt 0)

I facing a very silly problem - the color tag is not working. I tried many things but it is not happening. The CSS code is like this:
#block-menu_block_split-0 li {
list-style:none;
border-bottom: #D2D2D2 solid 1px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 4px;
padding-top: 8px;
margin-left:-25px;
margin-right:5px;
}

#block-menu_block_split-0 a:link, #block-menu_block_split-0 a:visited {
color:#FFFFFF;
font-weight:bold;
font-family:Arial, Verdana, Helvetica, sans-serif;
font-size:75%;
}

#block-menu_block_split-0 a:active {
text-decoration:line-through;
}

#block-menu_block_split-0 a:hover{
font-weight:normal;
}

The html is:
<div class="block block-menu_block_split" id="block-menu_block_split-0">
<div id="block-title"></div>
<div id="block-content">
<ul class="menu">
<ul class="menu"><li class="leaf first menu-224"><a href="/drupal/?q=internationalinteractions" title="International Interactions">International Interactions</a></li>
<li class="leaf active-trail"><a href="/drupal/?q=conferencefacility" title="Conference facility" class="active">Conference facility</a></li>
<li class="leaf"><a href="/drupal/?q=joinidsa" title="Join IDSA">Join IDSA</a></li>
<li class="leaf"><a href="/drupal/?q=executivecouncil" title="Executive Council">Executive Council</a></li>
<li class="leaf last menu-227"><a href="/drupal/?q=inmedia" title="in Media">In Media</a></li>
</ul>
</ul>
</div>
</div>

Thanks in advance

 

SuzyUK




msg:3906306
 11:18 am on May 4, 2009 (gmt 0)

do you mean your links, in that block, aren't white?

they are for me using this code

pathak




msg:3906313
 11:39 am on May 4, 2009 (gmt 0)

Yes. The links in the li are not white. They are appearing in default black.

SuzyUK




msg:3906454
 4:30 pm on May 4, 2009 (gmt 0)

Ok, they are white with this code you've provided, sorry if it sounded cheeky, just wanted to check

I'm going to take a guess that your CSS is not specific enough to override Drupal/or contributed Module - default CSS for those particular blocks, and that this is a custom block?

Have you got firebug installed, and do you know how to track down all the rules which are being applied to your blocks?

If so, simply click on one of your links and then check the CSS rules in the pane and see which rules are 'winning' , i.e., the ones that are giving your links the black color - once you find it - copy the whole selector into your theme's styles.css, then change the color in there

What that is doing is matching the default specificity, but your theme will then win because of the cascade, your styles.css should be the last of any CSS sheets to be called so as long as you match the default/module code that should be enough

If no firebug, then try adding IDs to your selector
#block-menu_block_split-0 a:link,
#block-menu_block_split-0 a:visited

There must be more ID's (or classes though ID's are more powerful) you can add to that selector to make it more specific (knowing Drupal there are plenty ;)), though they would have to be ones that common to each page that that block is on. e.g. blocks usually have a "content" class inside them, and your HTML shows that to be "block-content" so you could try

#block-menu_block_split-0 .block-content a:link,
#block-menu_block_split-0 .block-content a:visited

though that alone might not work as just adding classes is not all that powerful. It's hard to tell without seeing all your default CSS code (and no don't post it all thanks, even I can't sight read an entire Drupal theme across all sheets ;))

I would usually add ID's that are outside the block, the more IDs you can add to the selector the more specific it gets, actually no I usually like to remove all the Drupal defaults - though still use a default theme for the admin section, however it's a lot of work, so firebug is your best bet for tracking it down accurately if adding specificity doesn't work.

OR: if it is a contributed module you could try overriding their provided sheet (via your .info file) and just writing your own so you're not stuck in the specificity war. This is very easy to do in D6, but is a tutorial for another day if it turns out to be that

pathak




msg:3906937
 8:13 am on May 5, 2009 (gmt 0)

Thanks SuzyUK!

Firebug Did! I got the write class to edit.

Firebug is a great tool.

Thanks again SuzyUK

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved