Select all direct children of the <ul> element
4 answers
Use the child selector >:
ul > li { font-weight: bold; }
The only problem is that this does not work in IE6. See this list of CSS selectors and browser support .
If you need to support this browser, you will need to do something like this.
ul li { font-weight: bold; }
ul li li { font-weight: normal; }
. , , .
+8