Welcome to WebmasterWorld Guest from 54.196.244.45

Forum Moderators: not2easy

Message Too Old, No Replies

How to make headings with bold text

     
12:07 pm on Apr 4, 2014 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Oct 25, 2006
posts:995
votes: 0


I have tested H4 and H3. When I set <b></b> it will not work bold text. Is there some option to reset font-weight: inherit; which is inside browser detection

Element html, body is like:
html, body, strong, b {
font-family: inherit;
font-style: inherit;
}

Browser added item:
font-weight: inherit;

This will prevent H4 and bold text if needed.
12:14 pm on Apr 4, 2014 (gmt 0)

Junior Member

joined:June 6, 2012
posts: 104
votes: 0


Are you trying to change the font weight for the h4 and h3 elements from bold to normal?

If so you can use the following:

h3, h4 {
font-weight: normal;
}
7:49 pm on Apr 4, 2014 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12704
votes: 244


When I set <b></b> it will not work bold text.

Good: That means your CSS is doing what it's supposed to:
html, body, strong, b {
font-family: inherit;
font-style: inherit;
}

(Saying both "html" and "body" seems overkill, since how often do you have html outside the body?)

But why would you want to do this? The effect is to obliterate bold all the time, everywhere, unless you attach
{font-weight: bold;}

to some specific element and don't use a supplementary <b> tag (which would normally come inside any other element). Are you protecting against someone else coming along and absent-mindedly sticking in a <b>?

By default, all header <h1-6> elements are bold, left-aligned-- and probably much smaller than you want.

It's true that sometimes you'll use CSS to make things do the opposite of the default. In ebooks I often have this package:
.ital {font-weight: italic;}
em {font-weight: normal;}

but using it with bold seems odd.
8:53 am on May 7, 2014 (gmt 0)

New User

joined:May 7, 2014
posts:10
votes: 0


You can try something like following

#div h4 {

font-weight: normal;

}

It will work if you have something like following.

<div id="div-name">
<h4>Hello</h4>
</div>