Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6228903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:28:08+00:00 2026-05-24T09:28:08+00:00

I cannot understand what this codes means – 1) .main ul ul, 2) .main

  • 0

I cannot understand what this codes means –

1) .main ul ul,
2) .main ul li:hover ul ul
3) .main ul li:hover ul
4) .main ul ul li:hover ul

These codes are applied to hide or display menus & sub-menus .Those who are aware of CSS knows well of these codes. I thought much but cannot clearly understand!!
This is because the above codes are applied in this way-

.main ul ul,
.main ul li:hover ul ul 
{display: none;}

Then again –

.main ul li:hover ul,
.main ul ul li:hover ul
{display:block;}

My question is,in case of 2 ul’s we just use “.main ul ul” & then in the next line we use hover.
But without hovering over how can we get 2 ul’s?
I mean it should be ul:hover ul in the first line,isn’t it?
Also if the first 2 lines(i.e.- .main ul ul,
.main ul li:hover ul ul )are used for display:none ,then why the same 2 lines are not used for display:block???Because they should imply the same submenus?

Here .main is a div class like this-

 <div class="main">
  <ul>
    <li>..</li>
    <li>..</li>
     <li>..</li>
        <ul>
           <li>sub-menu1</li>
           <li>sub-menu2</li>
        .
        . 
        .
     </ul> etc etc...
<div> 

Actually this is a type of vertical list menu with submenus.
Hope you all get me.In simple words, my question what does the first 4 code lines at the very beginning of this question means?
Pls explain in details.
Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T09:28:09+00:00Added an answer on May 24, 2026 at 9:28 am

    1) .main ul ul refers to:

    <div class="main">
        <ul>
            <li>
                **<ul>** ... **</ul>**
                **<ul>** ... **</ul>**
            </li>
        </ul>
        ...
    </div>
    

    2) .main ul li:hover ul ul refers to the following, ONLY when the mouse is over the first level <li> (marked with 1 asterick), notice how this <ul> is another level deeper form the last example

    <div class="main">
        <ul>
            *<li>*
                <ul>
                    <li>
                        **<ul>**...**</ul>**
                        **<ul>**...**</ul>**
                    </li> 
                </ul>
                <ul> ... </ul>
            *</li>*
        </ul>
        ...
    </div>
    

    3) .main ul li:hover ul refers to the **<ul>** when your mouse is over the *<li>*

    <div class="main">
        <ul>
            *<li>*
                **<ul>**
                    .
                    .
                    . 
                **</ul>**
                **<ul>** ... **</ul>**
            *</li>*
        </ul>
        ...
    </div>
    

    4) .main ul ul li:hover ul refers to the **<ul>** when your mouse is over the *<li>* in this last example, notice how a level deeper <li> is now the responding to afocus of your mouse:

    <div class="main">
        <ul>
            <li>
                <ul>
                    *<li>*
                        **<ul>**...**</ul>**
                        **<ul>**...**</ul>**
                    *</li> *
                </ul>
                <ul> ... </ul>
            </li>
        </ul>
        ...
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot understand why the code below is giving me this error in firebug
I cannot understand how this is possible. Please help!! I have an app with
I cannot understand why this throws undefined reference to `floor' : double curr_time =
I understand what the CalledFromWrongThreadException exception means, but I cannot comprehend how the code
I cannot understand why this piece of code does not compile: namespace A {
I cannot understand this piece of code: public class BookCategory { public string CategoryName
foo\r\nbar.replace(/(foo).+/m, bar) Hello. I can not understand why this code does not replace foo
This is the problem described in Programming pearls . I can not understand binary
I cannot understand the Oracle documentation. :-( Does anybody know how to fetch multiple
I cannot understand the calculation 66 ⊕ fa = 9c. The sum is clearly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.