0
why are the classes(.xxxx) refered to with a letter in front?. p.xxxx is more work. only need .xxxx
useless letter in front of class name.
7 Answers
+ 17
Assuming its css you talk about:
In css, with p.class you get all <p> elements that belong to the class, without that letter, you get all elements that belong to the class regardless of their type, this way you can chain tags, ids, classes etc to identify which html elements will be affected by the css block.
0
What do you mean?
0
CSS using something like.... p.example
HTML
p class="example".
you dont require the p.example when .example works.
0
Oh I thought you meant classes in Python
0
thanx!
0
i suppose you're talking about css classes, in this case the answer is: specificity.
p.xxxx is more specific then .xxxx so its properties will be taken.
another case could be when you use the same class on different tags.
0
thanx all, now and forever.