What does "ul#menu li ul.sub-menu {" mean?
-
-
Answer:
You see two things: 1. A CSS selector: ul#menu li ul.sub-menu 2. An opening (curly) brace {, which should be followed by zero or more css declarations, and a closing brace }. The CSS selector determines to which elements the CSS declarations ("styles" from now on) are applied to. The easiest way to understand the CSS selector is to read its individual components from right to left. To start with, the styles only apply to ul elements with class "sub-menu". I.e. you'd see something like <ul class="sub-menu"> in the HTML. Furthermore, it only applies to those ul elements which appear somewhere nested inside a li element. Those li elements in turn need to be nested inside an ul element with id "menu", i.e. something like <ul id="menu"> An example of what is matched: <ul id="menu"> <li> <ul class="sub-menu">THIS IS MATCHED</ul> </li> </ul> The selector in fact matches many more types of element hierarchies, because both <li> and <ul class="sub=menu"> may appear anywhere, deeply nested. They do not have to be direct children of their parent element. For example this would be matched too: <ul id="menu"> <li> <div> <ul class="sub-menu">THIS IS MATCHED</ul> </div> </li> </ul> The specified styles are applied to the element that is matched. However, some styles (for example font-size or font-color) are inherited by child elements from their parent element, so setting a different font-size or color on the ul will affect any child elements (likely li elements) and all their descendants as well.
Myrne Stol at Quora Visit the source
Other answers
the html of that would be <ul id="menu"> <li> <ul class="sub-menu"></ul> </li> </ul> so it styles the sub-menu class
Aurel Kurtula
Related Q & A:
- Settings options not showing up on Sub Menu page in WordPress plugin?Best solution by WordPress
- What does the lil star on yahoo messenger mean?Best solution by Yahoo! Answers
- What is another name for a sub-committee?Best solution by thesaurus.com
- What do the lines on the Korean flag mean?Best solution by en.wikipedia.org
- What does to jail break the iPod touch mean?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.