li vs li li

Thread Solved

Join Date: Feb 2008
Posts: 630
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster

li vs li li

 
0
  #1
Dec 12th, 2008
I am very new to css. I was looking at a css file I found online and trying to figure out what everything does. I am confused with the following couple of things. Please let me know if anything I say is wrong!

This on sets up some properties of a list item in a <div id="sidebar"> environment
HTML and CSS Syntax (Toggle Plain Text)
  1. #sidebar li {
  2. margin-bottom: 10px;
  3. background: url(images/img10.gif) no-repeat left bottom;
  4. }
Now these two thing I was confused about:
HTML and CSS Syntax (Toggle Plain Text)
  1. #sidebar li ul {
  2. padding: 0 30px 40px 30px;
  3. }
HTML and CSS Syntax (Toggle Plain Text)
  1. #sidebar li li {
  2. margin: 0;
  3. padding-left: 30px;
  4. background: url(images/img12.gif) no-repeat 5px 50%;
  5. }

What is a li ul? and an li li?

Thanks!

Dave
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 596
Reputation: buddylee17 has a spectacular aura about buddylee17 has a spectacular aura about 
Solved Threads: 125
buddylee17's Avatar
buddylee17 buddylee17 is offline Offline
Posting Pro

Re: li vs li li

 
0
  #2
Dec 13th, 2008
li-list item; ul- unordered list; They are used to create a list in html.
Read more at http://www.w3schools.com/TAGS/tag_li.asp
Lost time is never found again.
- Benjamin Franklin
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 630
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster

Re: li vs li li

 
0
  #3
Dec 13th, 2008
right, but i asked what
ul li
and
li li
are?
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 437
Reputation: Fungus1487 is on a distinguished road 
Solved Threads: 50
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Pro in Training

Re: li vs li li

 
2
  #4
Dec 13th, 2008
css works by nesting. so...

Originally Posted by daviddoria View Post
ul li
"li" is found below "ul"

Originally Posted by daviddoria View Post
li li
"li" is found below "li"

Example
HTML and CSS Syntax (Toggle Plain Text)
  1. <div>
  2. <ul>
  3. <li>
  4. <ul>
  5. <li>Text 01</li>
  6. </ul>
  7. </li>
  8. <li>Text 02</li>
  9. </ul>
  10. </div>

HTML and CSS Syntax (Toggle Plain Text)
  1. ul li {
  2. color:#aaaaaa;
  3. }
  4.  
  5. ul ul li {
  6. color:#ff3333;
  7. }

The style for "ul li" will set all "li" elements found under a "ul" element to the color "#aaaaaa" in the example above this means all text will be of the color "#aaaaaa".

The second style for "ul ul li" will set all "li" elements found under a "ul" which is found under a "ul" to the color "#ff3333". Only the text "Text 01" will be of this color as it is the only "li" element that has been nested within two "ul" tags.

Hope this helps clarify.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 630
Reputation: daviddoria is a jewel in the rough daviddoria is a jewel in the rough daviddoria is a jewel in the rough 
Solved Threads: 46
daviddoria daviddoria is offline Offline
Practically a Master Poster

Re: li vs li li

 
0
  #5
Dec 13th, 2008
fantastic, thanks!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC