hidrau
asked on
Doubt using css and class and tag
Hello guys
I have this code:
How can I have the background-color of my class='book' and h2 only in pink without afecting the other class='book'?
I want to select it by class and tag
thanks
Alex
I have this code:
<html>
<head>
</head>
<style>
h1 {color: blue}
.book {background-color:yellow}
.caneta {background-color:green}
.book:h2 {background-color:pink}
body {background-color:black}
</style>
<body>
<h1> Olá, esse é o meu primeiro código html com h1 </h1>
<h1> Olá, esse é o meu primeiro código html com h1 </h1>
<h1> Olá, esse é o meu primeiro código html com h1 </h1>
<h1 class='book'> Olá, esse é o meu primeiro código html com h1 </h1>
<h1 class='book'> Olá, esse é o meu primeiro código html com h1 </h1>
<h1 class='caneta'> Olá, esse é o meu primeiro código html com h1 </h1>
<h1 class='caneta'> Olá, esse é o meu primeiro código html com h1 </h1>
<h1> Olá, esse é o meu primeiro código html com h1 </h1>
<h1> Olá, esse é o meu primeiro código html com h1 </h1>
<h1> Olá, esse é o meu primeiro código html com h1 </h1>
<h2 class='book' > Olá, esse é o meu primeiro código html com h2 </h2>
<h2> Olá, esse é o meu primeiro código html com h2 </h2>
</body>
</html>
How can I have the background-color of my class='book' and h2 only in pink without afecting the other class='book'?
I want to select it by class and tag
thanks
Alex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot