Understanding CSS inheritance

Hi,

The more I work with CSS the more I realize how much I don’t know. I just created
a small web site and this is the first time I see this. When viewed in FF, Safary or Chrome,
no problems, everything works fine but today when I tested it in IE7 some of the fonts are huge, it
looks like somehow some of the fonts are inheriting properties from other elements.

Can someone explain what is going on here and explain a little bit about how inheritance works in IE (or in other browsers)?

Here is the <snip /> to the site I’m currently working on.

Thanks a lot.

(You haven’t given a link…)

Inheritance should work the same in IE as any other browser.

If you don’t specify a CSS property, and the element has no default value, it will inherit its value from the parent element.

For example - there is no default ‘color’ property. If you don’t specify a colour, the browser will use its own default colour (which can usually be changed by the user). So colour is inherited. If you set div#content {color:red;} then all text in <div id=“content”>, including in child elements, will be red unless you tell it otherwise.

Counter example - elements do have default padding and margins. They vary from one element to another (and from one browser to another), so the default margins for <p> are different from <ul>, to take one case. So margins are not inherited. If you set div#content {margin:2em;}, then <div id=“content”> will have a 2em margin all round, but its child elements won’t inherit 2em margins of their own.

Ok, I thought this had something to do with IE because it works as intended in all other browsers. Thank you for the good explanation.

I think I’m missing body{font-size:100%;} I thought this was part of the reset I’m using but I probably accidently deleted it

Link should be working.

Thanks a lot!

It is, but McAfee and others are giving warnings that the site may pose a security risk.

It is, but McAfee and others are giving warnings that the site may pose a security risk.

Hmmm, now I’m a little scared about this.

Is there any way to know why is McAfee giving you a warning? What could be wrong?

http://www.siteadvisor.com/sites/Tu-Design.com

Thanks a lot for the link, I will take a look and see whats going on with my site.

Sorry I didn’t know about this problem … Can someone remove the link so no body else get this bad experience?

Sorry again, I love this forum and I would never do anything to hurt the awesome people here.

I’ve asked a Moderator to do that.

If you can post your code here, we can still help you with your original problem in the meantime.

Done.

Off Topic:

fs_tigre, you can click on the little red flag icon to the left of each post if you want moderators to do something with that post. Remove a link like in this case, or because it’s spam, or whatever reason you would like to draw the attention of the moderators to a post. When you report a post, you may also give a reason (which helps us understand why a post is reported), but that is not mandatory.

Thanks for the offer but I think I know whats wrong, I’m missing body{font-size:100%;}. I will try this later and if this doesnt solve my issue I may post the code directly. Thanks a lot.

Off Topic:

fs_tigre, you can click on the little red flag icon to the left of each post if you want moderators to do something with that post. Remove a link like in this case, or because it’s spam, or whatever reason you would like to draw the attention of the moderators to a post. When you report a post, you may also give a reason (which helps us understand why a post is reported), but that is not mandatory.

Oh, I didn’t know that, thanks a lot I will use this feature next time if I ever need to.

I think the bigger problem is that you end your <h1> tag with another <h1> instead of </h1>. IE thinks the heading tag is still open and so everything else is part of the top heading, whereas other browsers seem to have better error correction.

If you’re getting a display that doesn’t look like you think it should, it’s always worth running your site through the W3 validator and trying to get rid of any code errors that come up.

Thank you for your advice. I know the importance of validating but every time I try I get so many warnings that I don’t know where to start, I know I know this should be a must, I will try to make this as part of my process.

Stevie D, did you get the warning “TechnoBear” got or you are like me surfing the web without antivirus (I’m using a Mac, I know I should but…)?

Thanks

Ignoring warnings because you don’t know what they mean isn’t a good plan … often, like here, it will solve the problem. If you get really stuck with what the error messages mean and you just can’t figure them out, you can always ask here for help!

Stevie D, did you get the warning “TechnoBear” got or you are like me surfing the web without antivirus (I’m using a Mac, I know I should but…)?

I do have antivirus, but a different one to Bear, and it didn’t flag up any problems with the site.

Thanks a lot for your help!

As I said I will try to validate from now on, I should anyway.

Thanks a lot

Actually, I don’t have antivirus either - I’m on Linux. WOT flagged the site, but gave no explanation, so I went to McAfee to double-check, as WOT can be pretty hit-and-miss. With both of them giving warnings, I decided discretion was the better part of valour and retreated.

Thank you all for your help!

I downloaded my complete site and scanned it and I couldn’t find anything, I also used http://www.unmaskparasites.com to scan it annothing I dont know why McAFee is giving that warning. I will continue looking but I wont post any more here because this is kind of an off topic. I appreciate that you guy told me though.

CSS problem solved! Thanks a lot

Thanks a lot

Off Topic:

I took the liberty to check your original link, and I got no warnings on my Mac, though I have antivirus installed.

Thank you for taking the time to check the link ralph.m

“I just wish I could find a good book/article about web security to be conferment with the basics on securing my site”