By ryanbasicind@aol.com on
I want to display a background image inside a block. does anyone know how to display an image inside a block?
I want to display a background image inside a block. does anyone know how to display an image inside a block?
Comments
you can either use
you can either use block.tpl.php to theme that
block-module-delta.tpl.php
block-module.tpl.php
block-region.tpl.php
block.tpl.php
Ok I understand but I don't
Ok I understand but I don't want to apply it to all the blocks just one of them.
The block should have a
The block should have a unique ID in the HTML - something like id="block-something"
In the CSS you should be able to use that such as:
#block-something {
background: url(path_to_you_image);
}
The image could be one you have in your theme, maybe in an images folder so the path might start with images such as url(images/your_image.jpg)
Hope that helps.
Posted by arcX on October 30,
I'd like to try this for my top column blocks but can't work out how to do it exactly (I'm using Mayo theme): in the page.tpl.php page the blocks are listed as
$page['top_column_first'],
$page['top_column_second'],
$page['top_column_third'],
$page['top_column_fourth'],
));
and in template.php there's a function to build the column blocks which includes the current css class ('column-blocks'), but I can't work out how I can make individual classes for the blocks to generate different images for each block. Any help would really be appreciated.
Block Theme
Give Block Theme a spin.