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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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
.
回答2:
This should work:
ul li { /*css here */}
回答3:
You can use
ul li {
/* your code here */
}