Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I have been working on this all day with no luck. How do I style an individual block (containing a view output) in the sidebar?
I am already using Firefox Firebug but it looks like there are a couple of elements that come into play.
I have had success with styling blocks everywhere else in this theme but the sidebar is throwing me for a loop.
Thanks for your help.
Comment | File | Size | Author |
---|---|---|---|
#1 | block-configuration-page.jpeg | 60.03 KB | Deepika.chavan |
Comments
Comment #1
Deepika.chavan CreditAttribution: Deepika.chavan commentedHi,
Try using 'Block Class' module - http://drupal.org/project/block_class .
1. Enable the module.
2. Add following snippet to your theme's 'block-right.tpl.php' and 'block-left.tpl.php' file :
And here's what the code should look like after adding the snippet in 'block-right.tpl.php' :
code after adding the snippet in 'block-left.tpl.php' :
3. To add a class to a block, simply visit that block's configuration page at Admin > Site Building > Blocks (please see the attachment) .
Now by using this class attribute you can style an individual block in the sidebar.
e.g in my case I have added following css code for primary link block.