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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:28:31+00:00 2026-05-23T00:28:31+00:00

Considering the following code: <div style=float: left;> <select style=width: 160px;> <option>asd flkjh asdfkljha sdlkfjhasldjkfh

  • 0

Considering the following code:

<div style="float: left;">
  <select style="width: 160px;">
    <option>asd flkjh asdfkljha sdlkfjhasldjkfh aslkjdfh asjdhf alksjdhl k</option>
    <option>1</option>
    <option>2</option>
  </select>
</div>

<div style="float: right;">
  <select style="width: 160px;">
    <option>asd flkjh asdfkljha sdlkfjhasldjkfh aslkjdfh asjdhf alksjdhl k</option>
    <option>1</option>
    <option>2</option>
  </select>
</div>

When opening the right selectbox, the contents of the dropdown go off the screen. Also when the list would be longer, you would not be able to scroll through the list (only with mousewheel and keyboard, but the scrollbar is invisible)

Is there a fix for this? Ofcourse you could set a width / max-width on the options, but that would cut off the contents of the option element. Any suggestions?

  • 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-23T00:28:31+00:00Added an answer on May 23, 2026 at 12:28 am

    I think you mean the right side of the select box is not visible so the user cannot use the scroll-bar.

    You have 2 potential options that I can see outside of changing to a JavaScript solution, the first is to repostition the elements to allow for longer content.

    The second is to specify the width of the element to a percentage value as below, the downside is the width of the select element will be dynamically changed and you will lose some design control.

    <div style="float: right;">
      <select style="width:100%">
        <option width="">asd flkjh asdfkljha sdlkfjhasldjkfh aslkjdfh asjdhf alksjdhl k</option>
                <option>1</option>
                <option>2</option>
            </select>
        </div>

    I did a quick test in Chrome and Firefox, you can use what ever percentage value you want to, I tested on 100% and 50%, on 50% – depending on the nature of the content or any place holder values like “–SELECT–“, the element will only show half the length of the longest item.

    I would look into most likely look into jQuery plugins or other JavaScripts for a better solution depending on my needs at the time.

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

Sidebar

Related Questions

Considering the following architecture: a base object 'Entity' a derived object 'Entry:Base' and a
I'm considering the following: I have some data stream which I'd like to protect
Considering such code: class ToBeTested { public: void doForEach() { for (vector<Contained>::iterator it =
Considering this code, can I be absolutely sure that the finally block always executes,
Considering private is the default access modifier for class Members, why is the keyword
Considering the criteria listed below, which of Python, Groovy or Ruby would you use?
Considering a large system with hundreds of assemblies, what is the easiest way to
Considering you have an MVVM Architecture in WPF like Josh Smith's examples How would
Considering the full list of PDC videos published here what are, in your opinion,
Considering there are so many draconian firewalls in the world, is there any reason

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.