CSS - div class problem | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

CSS - div class problem

I have several divs with the same class, but when trying to make them all have the same CSS style, it only applies to the first one. Any hints on why? Thanks!

7th Sep 2020, 10:26 AM
Jann Basso
Jann Basso - avatar
7 Respuestas
+ 2
Can't tell without looking at the code that is causing the problem
7th Sep 2020, 10:31 AM
Abhay
Abhay - avatar
+ 2
in html your other div, missing closing tag </div>
7th Sep 2020, 12:49 PM
Rei
Rei - avatar
+ 1
here it is: https://code.sololearn.com/WIEdlV8parNi/# the div class = section. i think it's only working on the first one. thank you!!
7th Sep 2020, 12:28 PM
Jann Basso
Jann Basso - avatar
+ 1
I changed it to pink, but it still gets the same error :/ The other blocks are not applying the white box around each div (as I divided, it was per topic). So if you see, only the "Who am I?" is correct, the rest has a white box from start to end, including all the other topics in the same. I wanted each topic to have its own box, you know?
7th Sep 2020, 12:47 PM
Jann Basso
Jann Basso - avatar
0
Jann Basso change the background color to pink ,you will see that it's working
7th Sep 2020, 12:38 PM
Abhay
Abhay - avatar
0
oh my god, so simple! i feel stupid haha thank you so much!!
7th Sep 2020, 12:52 PM
Jann Basso
Jann Basso - avatar
0
Well I thought at first it might be a div tag that isn't closed but cudn't figure out in the code ,but adding pink worked fine atleast for color
7th Sep 2020, 1:06 PM
Abhay
Abhay - avatar