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

  • Home
  • SEARCH
  • 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 3240124
In Process

The Archive Base Latest Questions

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

I’m trying to create a div that would have a dynamic width depending on

  • 0

I’m trying to create a div that would have a dynamic width depending on the content inside that div. It works well in Firefox but in IE I get linebreaks, see screenshot below:

alt text

The markup looks like this:

<div class="filter-dropdown">
    <div class="filter-dropdown-options-wrapper">
        <ul>
            <li>
                <label>
                    <input type="checkbox" checked="checked">(Select All)
                </label>
            </li>
            <li>
                <label>
                    <input type="checkbox" value="2010-01-31" checked="checked">2010-01-31
                </label>
            </li>
        </ul>
    </div>
    <div class="filter-btn-wrapper">
        <input type="button" value="Ok" class="btn-filter-ok">
        <input type="button" value="Cancel" class="btn-filter-cancel">
    </div>
</div>

and CSS looks like this:


 .filter-wrapper div.filter-dropdown{
 position:absolute;
 top:-190px;
 right:10px;
 border:1px solid #CFD6DA;
 z-index:10000;
 display:none;
 padding:10px;
 height:170px;
 background-color:#EEF1F2;
}

.filter-wrapper div.filter-dropdown .filter-dropdown-options-wrapper{
 border:1px solid #CFD6DA;
 padding:5px 10px;
 height:130px;
 overflow-y:auto;
 background-color:#FFFFFF;
 width:100%;
}

.filter-wrapper div.filter-dropdown .filter-dropdown-options-wrapper ul{
 list-style:none;
 padding-left:0px;
 margin:0px;
}

.filter-wrapper div.filter-dropdown .filter-dropdown-options-wrapper ul li label{
 display:block;
}

.filter-wrapper div.filter-dropdown .filter-btn-wrapper{
 margin-top:10px;
 text-align:right;
 width:130px;
}

.filter-wrapper div.filter-dropdown .filter-btn-wrapper .btn-filter-ok{
 margin-right:5px;
 width:60px;
}

So, my question is – what do I have to do in order to avoid linebreaks and keep width of the outer div dynamic?

  • 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-17T18:02:59+00:00Added an answer on May 17, 2026 at 6:02 pm

    First, make your padding/margins on the right side of your inputs and that box small enough that it doesn’t WANT to wrap. It’s wrapping because it’s running out of room. If you set the background color of the labels you’ll probably see where it’s ending.

    Lastly as a failsafe you can set white-space: nowrap; but this should be a failsafe for funky font size issues and such not your primary solution because it will introduce complications of horizontal scroll bars etc.

    Edit: Also, you need to get your <input...> tags out of the <label...> tags. The labels should be attached to the inputs by name, not by virtue of being inside them!

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

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.