开发者

CSS psuedo-class first-line overrides first-letter

开发者 https://www.devze.com 2023-01-09 21:02 出处:网络
My problem is this, that I 开发者_StackOverflowwant to style the first line and first letter of every paragraph but the first-line attributes move on to the first-letter attributes even if I re-declar

My problem is this, that I 开发者_StackOverflowwant to style the first line and first letter of every paragraph but the first-line attributes move on to the first-letter attributes even if I re-declare them in the declaration of first-letter.

This is how the code looks:


p:first-line {
 font-variant:small-caps;
}
p:first-letter {
 font:none;
 font-variant:none !important;
 font-family: firstLetterFont !important;
 font-size:200%;
 font-weight:bold;
}

The problem is that my custom font (firstLetterFont) is not being used for the first-letter, instead the default Times New Roman is used. I placed !important tags but to no avail.

Anyone have any method of overriding the attributes of first-line?


Oops, sorry, rookie mistake.

Seems there is no such thing as "none" for font-variant, is should be set to "normal".

My bad.

0

精彩评论

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