css - CSS3 selectors - select very first item or item after -


let's have following code:

<nav id="main-navigation">     <ul>         <li><a href="#">link 1 level 1</a></li>         <li><a href="#">link 1 level 1</a></li>         <ul>              <li><a href="#">link 1 level 2</a>         </ul>     </ul> </nav> 

and want to set first ul's height 100px , second ul should 300px.

when try

nav ul {      height: 100px } 

second ul inherits value.

i trying "~", "+", ">", first-childs etc. don't know how that, documentation.

is there explained (preferably demos/screens) guide new css3 selectors? w3 table nerdy me.

thanks!!!

just select ul descendant of ul , give style, if have 2 layers of <ul>s. no need special css2/css3 combinators since <ul> cannot directly contain <ul>, plus don't have worry ie either.

nav ul {      height: 100px; }  nav ul ul {      height: 300px; } 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -