943,961 Members | Top Members by Rank

Ad:
Dec 12th, 2008
0

li vs li li

Expand Post »
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
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is offline Offline
1,968 posts
since Feb 2008
Dec 13th, 2008
0

Re: li vs li li

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
Reputation Points: 232
Solved Threads: 137
Practically a Master Poster
buddylee17 is offline Offline
665 posts
since Nov 2007
Dec 13th, 2008
0

Re: li vs li li

right, but i asked what
ul li
and
li li
are?
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is offline Offline
1,968 posts
since Feb 2008
Dec 13th, 2008
2

Re: li vs li li

css works by nesting. so...

Click to Expand / Collapse  Quote originally posted by daviddoria ...
ul li
"li" is found below "ul"

Click to Expand / Collapse  Quote originally posted by daviddoria ...
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.
Reputation Points: 66
Solved Threads: 56
Posting Pro in Training
Fungus1487 is offline Offline
459 posts
since Apr 2007
Dec 13th, 2008
0

Re: li vs li li

fantastic, thanks!
Featured Poster
Reputation Points: 437
Solved Threads: 204
Posting Virtuoso
daviddoria is offline Offline
1,968 posts
since Feb 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Multiple styles of list in 1 css file
Next Thread in HTML and CSS Forum Timeline: missing background





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC