Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What could cause a bold tag <b> to be ignored?

Tags:

html

css

tags

bold

I have an issue with some HTML displayed in Drupal, but I am not 100% sure this is a Drupal issue. I am using the bold tag to emphasize a word, but it is not displayed as bold. It thought it might be the Google font I used, so I disabled it, but I still get the issue.

I checked the page source:

<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:

enter image description here

What could be causing this issue?

UPDATE

There is indeed a reset.css in the theme I am using. Bold is defined as:

b{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}
like image 405
Jérôme Verstrynge Avatar asked Dec 27 '22 04:12

Jérôme Verstrynge


1 Answers

A CSS (reset) sheet has probably defined b{font-weight:normal;}. To "fix" the style, add b{font-weight:bold;}.

Also, he <strong> tag is semantically more correct, so use that instead of <b>.

like image 50
Rob W Avatar answered Jan 14 '23 14:01

Rob W