How can i separate two same tag in CSS tag? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can i separate two same tag in CSS tag?

html=<p class="serif">solo learn</p> <p class="serif">I love my country</p> CSS=P.serif{font-family:"Times New Roman",Times,serif color:red} p.serif{font-family:"Times New Roma ",Times,serif color:blue} When this code is comes to run then output always take 2nd CSS tag. it means two tags color is blue..solo learn is suppose to be red but it show color blue...so, how can i separate this two tags?

30th Apr 2020, 3:07 PM
Ajoy Chowdhury
Ajoy Chowdhury - avatar
4 Answers
+ 3
You can't seperate two same tag with same class however if they have different tags than you can but not with same tags and same classes for that use different classes or id's
30th Apr 2020, 3:09 PM
Abhay
Abhay - avatar
+ 3
Use two different classes, e.g.: .serif1 and .serif2
30th Apr 2020, 8:28 PM
dozule
dozule - avatar
+ 2
thanks
1st May 2020, 3:00 AM
Ajoy Chowdhury
Ajoy Chowdhury - avatar
0
In this tag what will be the different classes or id's?
30th Apr 2020, 4:05 PM
Ajoy Chowdhury
Ajoy Chowdhury - avatar