homepage Welcome to WebmasterWorld Guest from 184.72.69.79
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderator: open

CSS Forum

    
How to make headings with bold text
toplisek




msg:4660359
 12:07 pm on Apr 4, 2014 (gmt 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.

 

brandozz




msg:4660360
 12:14 pm on Apr 4, 2014 (gmt 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;
}

lucy24




msg:4660488
 7:49 pm on Apr 4, 2014 (gmt 0)

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.

abiabiah




msg:4669169
 8:53 am on May 7, 2014 (gmt 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>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved