7

We use a CSS reset file that names every element from html to p to img, etc. and resets the margins, heights, sizes, etc. A pretty standard reset file. However, a client noticed that their <sub> and <sup> tags were not appearing as subscript and superscript should. So, I removed the and tag references from the reset file in hopes of this fixing the problem. It has fixed it in FireFox and Safari but it still remains in IE6 and IE7.

Is there something I'm missing here? Are these tags inheriting their styles from another tag in the reset? And, is there any way to use CSS to re-do whatever may have been undone to the <sub> and <sup> tags in the reset? Thanks for your help.

4

3 に答える 3

13
sup {vertical-align: super; }
sub { vertical-align: sub; }
于 2009-11-29T13:54:14.577 に答える
6

css のリセットはフォント サイズに影響を与える可能性があるため、次のようにしました。

sub {
    vertical-align: sub;
}
sup {
    vertical-align: super;
}
sub, sup {
    font-size: 0.5em;
    line-height: 100%;
}

ブラウザによっては、 で異なるvertical-align値を試す必要があるかもしれません。sub

于 2011-08-30T14:46:24.987 に答える
1

リセット ファイルを見ないと、確実なことは言えません。これをデバッグする最も簡単な方法は、リセット ファイルを退屈なページにロードし、firebug を壊して、計算されたスタイルがどのように見えるかを正確に確認することです。リセット ファイルには、IE にのみ適用される CSS ハックが含まれている場合もあります。

vertical-align元の外観に戻すために調整を使用することもできますfontが、リセットのその部分が望ましくない場合は、これらの要素に影響を与えるルールを削除する方がよいと私は言いたいです.

于 2009-10-13T19:04:25.493 に答える