How do I style blocks?
gleble - May 5, 2008 - 17:00
I have created a block and put html code in but there is no styling. I know I could do it inline but is there a solution using block.tpl.php? If not how can it be done?
I have created a block and put html code in but there is no styling. I know I could do it inline but is there a solution using block.tpl.php? If not how can it be done?
=-=
http://drupal.org/node/198506
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )
css
Does that mean I write the css directly into block.tpl.php?
If you look at the HTML
If you look at the HTML source code for the blocks you will see that blocks carry id's and classes so that they can be styled as individuals or groups. The code in the block.tpl.php does not need to be modified. It is here that the HTML gets written.
<div class="<?php print "block block-$block->module" ?>" id="<?php print "block-$block->module-$block->delta"; ?>"><div class="title"><h3><?php print $block->subject ?></h3></div>
<div class="content"><?php print $block->content ?></div>
</div>
Hiveminds Magazine | FireOrb | Drupal Street | Drupal offline manual