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 994777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:37:22+00:00 2026-05-16T06:37:22+00:00

How can I indent categories and endless sub categories that I have in a

  • 0

How can I indent categories and endless sub categories that I have in a select drop down menu using CSS?

   1. Apple
   2. Arts & Entertainment
         1. Amusement
         2. Art
         3. Artists
               1. A
                     1. a1
                     2. a2
               2. B
               3. C
               4. D
   3. Automotive
   4. Network
   5. Server
   6. Web Design
         1. CSS
         2. HTML
  • 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-16T06:37:23+00:00Added an answer on May 16, 2026 at 6:37 am

    You can’t do this with the <select> element. You can’t have endless nested subcategory like you suggest, only one, with <optgroup>. Styling will also be difficult as the ability to style form elements differs from browser to browser.

    However, depending on your needs, the following solution might work:

    For this, we are recreating the select element using HTML lists. The markup would look like this:

    <div id="select">
        <p>Select your Answer</p>
        <ul>
            <li><a href="#">Apple</a></li>
            <li><a href="#">Arts and Entertainment</a>
                <ul>
                    <li><a href="#">Amusement</a></li>
                    <li><a href="#">Art</a></li>
                    <li><a href="#">Artist</a>
                        <ul>
                            <li><a href="#">A</a></li>
                            <li><a href="#">B</a></li>
                        </ul></li>
                </ul>
            </li>
        </ul>
    </div>
    

    Then, with CSS, style it such that it fits your purpose:

    #select {
        border: 1px solid #999;
        background-color: rgba(0, 0, 0, 0.1);
        position: absolute;
        width: 300px;
        font-family: Arial, sans-serif;
        font-size: 11px;
    }
    
    #select:hover {
        background-color: #efefef;
    }
    
    #select > ul {
        display: none;
        list-style: none;
    }
    
    #select:hover > ul {
        display: block;
    }
    
    #select > ul ul {
        margin-left: 20px;
    }
    
    #select > ul a, #select > p {
        display: block;
        padding: 3px 8px 4px;
        color: #333;
        text-decoration: none;
    }
    
    #select > ul a:hover {
        background-color: #ddd;
    }
    

    Play around with it here: http://jsfiddle.net/thHFS/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a c# library that can help to write and indent Javascript code.
I searched around the webs and found tools that can indent java,C,php,HTML etc. Is
Using the Eclipse SWT StyledText widget, how can you indent/un-indent a selected block of
I have elements with classes that can be like this: class=refType indent_00 class=refType indent_01
I want to use jQuery to animate a simple vertical menu that can be
Any body can explain this CSS property please? text-indent: -1e+7px; Thank you.
Hi I’m new to android and I’m developing a reminder that have three categories
I already know that gg=G can indent the entire file on Vim. But this
I know that indent is important in Haskell. How can i indent this program?
I'm using Visual Studio 2010 and C#. How can I indent the selected text

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.