I want to write a CSS selector that selects all li elements within a ul element in a document but I don't know how that would be done. Can you help?
CSS to select all li in ul
Asked Answered
ul > li {
/* css styles go here */
}
or
ul li {
/* css styles go here */
}
the first selects only direct children the second selects all li
nested within an ul
.
Probably, someone else with a duplicate answer. –
Straitjacket
+1 the first to answer. but the second part was enough according to OP –
Icy
@Icy well, better than always doing only the minimum just for being first and trying to get upvotes, right? –
Galengalena
© 2022 - 2024 — McMap. All rights reserved.
ul
element or just one particular such element? This goes down to just about the basics, and I suggest you peruse the many existing basic tutorials/guides out there which have the basics widely covered, as well as use search. – Pregnancy