block CSS- can't get it to work

auroramae - February 20, 2009 - 01:17

I am having a hard time editing one block in a sidebar.
I've done an exhaustive search and tried #block-block-9 and many other variations of the ID.

Here is the code form the source.

<div class="block block-block" id="block-block-9">
    <div class="content"><!--paging_filter--> block content goes here</div></div>
</div>
          </div>

My sidebar blocks have a border and a colored background and all I want to do is remove the border and use a white background.

So this should work...

#block-block-9 {
  background-color: #ffffff;
  border:none;
}

or this?
#block-block-9 .block{
  background-color: #ffffff;
  border:none;
}

or maybe this?
#block-block-9 .content {
background-color: #ffffff;
  border: none;
}

or a combination of the above
nothings works

any advice would be appreciated
aurora

Are these blocks created by

JohnnyHa - February 20, 2009 - 10:54

Are these blocks created by Views 2 ?
Normally if you have blocks from a specific module you do it by:

#block-module-id {
}

Re Ciews

auroramae - February 27, 2009 - 16:25

No Views are involved.
This block is created by me manually.
I also have a new block for tellafriend and I can't edit that CSS either.
The bullet is too far left and doesn't match any of the other blocks.

Is this a custom theme?

mokargas - February 28, 2009 - 06:54

Is this a custom theme? What's the structure of the page? Consider your selectors cascade.

Do you have this online anywhere, or can you post the CSS and the section of HTML you're having trouble with?

actually this is the priority

grevo - February 28, 2009 - 07:04

actually this is the priority problem that CSS does. you are saying that you have a background and a border on your block .. so you have given this style to .block {} .. am i right ?? .. and now you want to apply a specific style to on of your block ...

so .what you have to do is .. instead of #block-block-9 . use #sidebar-left #block-block-9 or #the-region-where-block-is #block-block-9 {} and give some value ...

the thing is this .. .block cascades/hides the #block-block-9 properties ... to you have to apply more weight on you selector so that your specific settings get more priority than the .block ...

Exactly. Well said Grevo! If

mokargas - February 28, 2009 - 07:08

Exactly. Well said Grevo!

If your styles are defined for that containers selector say #sidebar-left #block-block-9{} then any changes to your #block-block-9{} selectors will have no effect in the CSS cascade.

try blocktheme

psine - February 28, 2009 - 18:52

After hours or multiple tries at naming a new .tpl.php file to go with a block that I was creating via views, I finally installed blocktheme module and created the needed files in minutes.

(I have an earlier question in this forum that explains the problem I was having. I'd still like to know the answer.)

 
 

Drupal is a registered trademark of Dries Buytaert.