Example code:
https://jsfiddle.net/5x60gu95/
I want to target both divs (1 and 2), but they dont have any class or id. Halp pls
Example code:
https://jsfiddle.net/5x60gu95/
I want to target both divs (1 and 2), but they dont have any class or id. Halp pls
Why not give them a class or id then?
CSS descendent selectors will work here:
div div {
background-color: tomato;
display: block;
width: 100px;
height: 100px;
}
Hey Elian,
Are you trying to target those divs with CSS or with JavaScript?
Sorry for the late answer i’ve already fix it but nth-of-type could have been another solution, thank you.