Hi

i came across a liltle problem 2day, i cant seem to css style the title of a block, for example the 'navigation' block title. I edited block.tpl.php and it is now like this

<div class="block block-<?php print $block->module; ?>" id="block-<?php print $block->module; ?>-<?php print $block->delta; ?>">
    <h2 id="block-title"><?php print $block->subject; ?></h2>
    <div id="block-content"><?php print $block->content; ?></div>
 </div>

when i go and style #block-title it accepts everything like font size, color etc, apart from changing the font (or font family).Any ideas/solutions to that??

many thank,

Panos / Greece

Comments

nevets’s picture

It would help to see the css, it is possible you have a typo or some such but without the css it is hard to be specific.

Also, '#block-title' should really be a class and not an id. Id should only be used once within the html and since you have more that one block, the id #block-title' repeats itself (which is why it should be a class)

pan0s’s picture

thanks for the correction nevet, the code both html and css are below:

----HTML

 <div class="block block-<?php print $block->module; ?>" id="block-<?php print $block->module; ?>-<?php print $block->delta; ?>">
    <h2 class="block-title"><?php print $block->subject; ?></h2>
    <div class="block-content"><?php print $block->content; ?></div>
 </div>

----CSS

.block-title {
	color: #000000;
	text-align:center;
	font-size:27px;
	font:System; <----is it insane or its just my imagination?it gets everything else apart from font!!
        }

Nowhere else in css code is h2 styling or .block-title. Further help will be much appreciated.

nevets’s picture

I usually use font-family and have not had a problem. One thing I notice is you use 'System' which I do not think is a standard font and not one of the build in 'generic' names (like cursive, serif, etc).

pan0s’s picture

...right after all ... i used font family instead of font ;)
and by the way id like to say that the raw php templates you have contributed are an excellent start for first steps in developing a theme.Congrats, i wish i had seen them earlier!

thanks for your help nevet

nevets’s picture

Your welecome, just wanted to point out the raw php templates are someone elses work.