+ 5
Why p.serif? Why not only .serif?
4 ответов
+ 16
p .serif means wherever serif class will come within paragraph it will change its font family.
if you mention only .serif, it means it will change wherever the class value is serif irrespective of its element type.
Hope now it will clarify you doubt.
Thanks and Regards,
Saikat Basak
+ 2
I think it's like object of class serif..??
+ 1
Also, it is good to be specific so when you build things with many parts, you can have something to make an exact reference to when you want to change the css.
For this specifically, you might have a title and a paragraph in the same font, but only want to change the title's font size.
0
p.serif is specifically pointing to a paragraph or paragraphs with serif as its or their class. This simply means that the css rule would only apply to any paragraph (p) within a serif class (.serif) while .serif is kinda general which means that the rule would apply to any element within the serif class.. It could be a div element or even a heading as long as they've got the .serif in their html as the class.
Hope that helped.