user1128245
user1128245

Reputation: 363

CSS font-weight issue in body tag

i've been having a small issue with the font-weight property, when I put it into the body tag, it doesn't seem to work.(I have a < h1 > tag in my HTML which I don't want in bold). Of course if I would put the font-weight:normal; property inside the " * " it works. But it doesn't when I leave in the body. I know I can just use a h1 tag and put the font properties in there, but I'm curious as to why it isn't working for me.

Thanks , and here is my CSS code.

* {
margin:0px;
padding:0px;


}
body {
background-color: #DCDBD9;
color: #2C2C2C;
font-weight:normal; /*this doesn't seem to work*/
font-size:100%;
font-family: Cambria, Georgia, sans-serif;
}

Upvotes: 2

Views: 4681

Answers (2)

ptriek
ptriek

Reputation: 9286

  • The * selector will explicitely set the font-weight to each individual element, thus overriding the default font-weight:bold of an h1

  • Setting font-weight:normal to body won't change a thing, since the default font-weight value for bodyis normal.

  • The font-weight property on body won't be inherited by children who have a browser default font-weight, such as an <h1> or a <strong> tag.

Upvotes: 6

jeffknupp
jeffknupp

Reputation: 6304

Why wouldn't you just put the font-weight:normal in an h1 section of your CSS?

Upvotes: 0

Related Questions