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.
By pan0s on
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
Two points
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)
still not ok
thanks for the correction nevet, the code both html and css are below:
----HTML
----CSS
Nowhere else in css code is h2 styling or .block-title. Further help will be much appreciated.
I usually use font-family
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).
i got it....
...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
raw php templates someone elses work
Your welecome, just wanted to point out the raw php templates are someone elses work.