特定のタグを除外しながら、いくつかの html のスタイルを設定しようとしています。たとえば、以下に、2 つのテキストを異なるフォントでスタイル設定する html があります。
<span style="font-family: Tahoma, Arial, sans-serif">Test 1</span>
<span style="font-family: Verdana, Arial, Helvetica, sans-serif">Test 2</span>
<span style="font-family: Arial, Helvetica, sans-serif">Test 3</span>
Arial フォントではないスパンのスタイルを Times New Roman にオーバーライドしたいので、次の css を試しました。
span {
font-family: "Times New Roman" !important;
font-weight: normal !important;
font-size: 12pt !important;
font-size-adjust: none !important;
font-stretch: normal !important;
font-variant: normal !important;
font-style: normal !important;
background-color: white !important;
}
上記は Arial テキストのスタイルも変更するため、スタイル設定されている Arial テキストを除外したいと思います。
css は複数のソース html のスタイルを設定するために使用され、ソース html にはスタイル内にさらに多くのタグがあり、テキストのサイズ、重量などを定義する可能性があるため、スタイル タグのコンテンツは予測できないことに注意してください。
Arial フォントとしてスタイル設定されたタグを除外するように CSS に指示するにはどうすればよいですか。
また、Microsoft Word で html を開いて html を印刷するので、これは Word を使用しても機能する必要があります。