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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:02:58+00:00 2026-05-23T11:02:58+00:00

I have an HTML <select> that I want to appear as a list box

  • 0

I have an HTML <select> that I want to appear as a “list box” (a box that displays multiple items simultaneously, as opposed to a drop-down box). However, I only want to allow a single item to be selected. I also want to set the height of the box (via CSS) to be 100% of it’s container size.

These three things seem to be mutually exclusive. Setting the multiple attribute of the <select> element will make the control render as a list box instead of a dropdown. However, I don’t want multiple elements to be selected, so this doesn’t work. The only other way I know to make a <select> into a list box is to set the size attribute to a value > 1. This will also set the height of the box, and it appears that I can’t change the height via CSS when the HTML attribute is set.

  • 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-23T11:02:58+00:00Added an answer on May 23, 2026 at 11:02 am

    You can make the <select> 100% of the height of the <form> that contains it.
    See this fiddle for an example of a div enclosing a form, with a select filling the height of the form.

    This starts with a simple structure, just enough that the form is enclosed in something so you can see the relative layout.

    <div>
        <form>
            <select id="thelist" size="4">
                <option value="1">One</option>
                <option value="2">Two</option>
                <option value="3">Three</option>
                <option value="4">Four</option>
            </select>
        </form>
    </div>
    

    I give the div a height, a background so you can see it, and padding so it’s content doesn’t naturally cover it.
    Make the form any height you want, including 100% of the div. I made it 90% so you can still see the enclosing div. Notice the form’s width fills the div width except for the padding.

    You can then just set the height of the select list to anything you want inside the form. Here’s my CSS

    div {
        background-color: #fff0f0;
        height: 40em;
        padding: 1.5em 1.5em 0 1.5em;
    }
    form {
        background-color: #f0f0f0;
        height: 90%;
    }
    #thelist {
        height: 100%;
    }
    

    Put together as a snippet, and making it smaller to fit better here…

    div {
        background-color: #fff0f0;
        height: 20em;
        padding: 1.5em 1.5em 0 1.5em;
    }
    form {
        background-color: #f0f0f0;
        height: 40%;
    }
    #thelist {
        height: 100%;
    }
    <div>
        <form>
            <select id="thelist" size="4">
                <option value="1">One</option>
                <option value="2">Two</option>
                <option value="3">Three</option>
                <option value="4">Four</option>
            </select>
        </form>
    </div>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a <select> drop down that I'm inserting into my HTML via jQuery.
I have a html form which have a select list box from which you
I want to have a drop down menu where a user can select from
I want to the user to select an option from a drop down box
So, basically I have this select / drop down menu that I use AJAX
I have an HTML select list (let's call it List A) that is dynamically
Below are the options that I have in my HTML code: <label id="subn"> <select
I have n number of select elements in an html page that are used
i have a html select with options in my views . onchange i want
I have a html select list menu,when user select an option he/she is redirected

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.