Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ul li {} li ul {} ??? what is that????

Status
Not open for further replies.

soniclnd

Technical User
Jan 6, 2005
51
US
ok, so i was browsing throug some css and html templates because i wanna get into this whole css thing... but i've found this on a stylesheet

ul li{position: relative}

li ul{position: absolute;
left: 149px;
top: 0;
display: none;}


i know what all the properties and values mean but i do not understand the concept of the selectors "ul li" and "li ul"
does the first one mean a <li> that belongs to a <ul>,
and does the second one mean a <ul> that belongs to a <li>

i am really confused about this matter
 
The first one is simply any li that is within a ul element.

The second is a ul that is within an li.

Think nested lists.

You're looking at Suckerfish dropdowns right? ;)


Code:
<ul>
  <li>
    Item 1
  </li>

  <li>
    Item 2 <!-- This contains another list -->
    <ul>
       <li>Item 2.1</li>
       <li>Item 2.2</li>
       <li>Item 2.3</li>
    </ul>
  </li>

  <li>
    Item 3
  </li>
</ul>

- Web design and ranting
- Day of Defeat gaming community
"I'm making time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top