What can cause the bold <b> tag to be ignored?
I have a problem with some HTML being rendered in Drupal, but I'm not 100% sure if this is a Drupal problem. I'm using a bold tag to underline a word, but it doesn't appear as bold. He thought it might be the Google font I was using, so I disabled it, but I still have a problem.
I checked the source of the page:
<div id="begin_block">
<div id="fw_begin"><h2>Find words <b>beginning</b> with:</h2></div>
<div id="inp_begin"><input type="text" /></div>
<div id="aft_begin">(max. 5 characters)</div>
<div id="but_begin"><button type="button">Go</button></div>
</div>
But I still get:
What could be causing this problem?
UPDATE
The theme I'm using does exist reset.css
. Bold is defined as:
b{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}
source to share
What you need to do is use firebug
or google developer console
debug it. If you have no previous experience, at least one don't worry - it will pay to spend some time and find out.
As a real solution, you can wrap the text in <span>
instead <b>
, add it to some meaningful class like "stress" (but you should avoid class names like "bold" because you might end up changing your mind as well instead of font-font you would use an underline, in which case you either change the class name or have a bold class for the underline style) and add something like
.stress{
font-weight: bold !important;
}
You are most likely rewriting the font-weight somewhere, and it is important to make sure that it will not be overwritten anymore.
BTW: of course you don't need to use <span>
with the class name, you can also use other selectors like <strong>
etc.
source to share