Hello :)
I can't make it work:
Firebug: class="block block-block unstyled-block" --- so my block class is not working.
Here my node.tpl.php
<div class="block block-<?php print $block->module; unstyled-block" id="block- print $block->module; - print $block->delta; print block_class($block); if (function_exists(block_class)) print block_class($block); ">
if ($block->subject) {
print $block->subject;
}
if ($block->content) {
print $block->content; }
<?php
In my block settings, I put my name class: "red-block"
CSS class(es) : red-block (no "red-block" or tr.red-block, jsut red-block)
and in style.css:
tr.red-block {
background-color:#D6DFFE;
color: #FF00FF;
}
Do i miss something?
Thanks for the help^^
Comments
Comment #1
junro commentedsorry for this display
Comment #2
junro commentedComment #3
todd nienkerk commentedThe code should read like this:
You were outputting the block_class module stuff into
id=""instead ofclass="". Also, you were outputting block_class twice.Comment #4
junro commentedok thanks :) but stil not working.
I put exactly your code and now, with firebug I've got this:
class="block block-block unstyled-block red-block">
I shouldn't have "block-block unstyled-block" anymore.
but only:
class="block red-block" I think.
Comment #5
junro commentedhum if I use the block ID for css (#block-block-41), all working well.
What's better for theming blocks? CSS ID or CSS Classes? or it's the same... ?
Comment #6
todd nienkerk commentedJunro:
Your CSS is wrong. You're specifying a
trelement, which a block is not. The markup shows it's adiv, as in<div class="block ..."-- not atrelement. Change your CSS to this:Or this:
You need to read some basic documentation on CSS before you can get a hang of this. There are lots of CSS guides available online.
Now, regarding the classes that appear in the output, you should ignore
block-block. Just trust me on this.unstyled-blockappears because you've specifically put it there:If you don't want
unstyled-blockto appear, simply remove it from your code.Comment #7
junro commentedOups what a mistake!
Well It's working now thanks ^^