开发者

IE anchor tag font-size not inherited

开发者 https://www.devze.com 2023-03-04 04:34 出处:网络
I have a div with id \"banner\".Within the div, there are two links.The font size for the lin开发者_Python百科ks is larger than the font size of the parent div.I had to add the second line below for I

I have a div with id "banner". Within the div, there are two links. The font size for the lin开发者_Python百科ks is larger than the font size of the parent div. I had to add the second line below for IE to display the link at the same size as the rest of the div (other browsers were fine without this line). I tried ems too and had the same problem.

Why is the second line is necessary?

#banner {font-size:85%;}
#banner a, #banner a:active, #banner a:visited { font-size:100%;}


Suggestion 1: Try using font-size:1em; instead of 100%.

em is always relative to the parent element, so it should pick up the size of the parent.

Also, what happens if you just don't specify it at all? Unless you have something else overriding it, it should be going to the same size as the parent anyway. If you do have something else overriding it, could it be that is taking precedence over your 100%?

Which leads to suggestion 2: try adding the !important flag to the style or modifying your CSS so that the one you want moves ahead of the other one in the order of precedence.

0

精彩评论

暂无评论...
验证码 换一张
取 消