| | |
li vs li li
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Feb 2008
Posts: 630
Reputation:
Solved Threads: 46
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
Now these two thing I was confused about:
What is a li ul? and an li li?
Thanks!
Dave
This on sets up some properties of a list item in a <div id="sidebar"> environment
HTML and CSS Syntax (Toggle Plain Text)
#sidebar li { margin-bottom: 10px; background: url(images/img10.gif) no-repeat left bottom; }
HTML and CSS Syntax (Toggle Plain Text)
#sidebar li ul { padding: 0 30px 40px 30px; }
HTML and CSS Syntax (Toggle Plain Text)
#sidebar li li { margin: 0; padding-left: 30px; background: url(images/img12.gif) no-repeat 5px 50%; }
What is a li ul? and an li li?
Thanks!
Dave
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
Read more at http://www.w3schools.com/TAGS/tag_li.asp
Lost time is never found again.
- Benjamin Franklin
- Benjamin Franklin
css works by nesting. so...
"li" is found below "ul"
"li" is found below "li"
Example
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.
"li" is found below "ul"
"li" is found below "li"
Example
HTML and CSS Syntax (Toggle Plain Text)
<div> <ul> <li> <ul> <li>Text 01</li> </ul> </li> <li>Text 02</li> </ul> </div>
HTML and CSS Syntax (Toggle Plain Text)
ul li { color:#aaaaaa; } ul ul li { color:#ff3333; }
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
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: Multiple styles of list in 1 css file
- Next Thread: missing background
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 xml xsl





