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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:37:19+00:00 2026-06-11T08:37:19+00:00

I am trying to let the width of a div to be expanded according

  • 0

I am trying to let the width of a div to be expanded according to its content horizontally
the content is a floating divs , I want them to appear as one row

I used white-space: nowrap; but it is not working on IE and FF ( It works very fine on google chrome )
here is my HTML code :

<div class="floating_menu_container">    
    <div class="floating_menu">
        <div class="floating_menu_item account">
            <div class="sub_floating_menu">
                <div class="sub_floating_menu_item"></div>
                <div class="sub_floating_menu_item"></div>
            </div>
        </div>

    </div>
</div>

and this is the CSS code :

.floating_menu_container{
position: absolute;
top: 25px;
left: 5px;
height: 50px;
z-index: 5;
}

.floating_menu_container .floating_menu{
height: 0px;
width: 40px;
background: #4D75A6;
z-index: -1;
position: absolute;
top: 35px;
left: 7px;
}

.floating_menu_container .floating_menu .floating_menu_item{
width: 30px;
height: 30px;
background: #94acc9;
border: 1px solid #6991c2;
margin: 7px 0px 4px 4px;
cursor: pointer;
position: relative;
}

.floating_menu_container .floating_menu .floating_menu_item .sub_floating_menu{
height: 30px;
position: absolute;
top: 0px;
background: #4D75A6;
left: 42px;
border: 1px solid #003980;
z-index: 10;
cursor: default;
white-space: nowrap;
}

.floating_menu_container .floating_menu .floating_menu_item .sub_floating_menu .sub_floating_menu_item{
width: 20px;
height: 20px;
background: #94acc9;
margin: 5px;
float: left;
cursor: pointer;
}

and here is the example on jsfiddle

I want to expand the div with class=’sub_floating_menu’ according to its content

  • 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-06-11T08:37:20+00:00Added an answer on June 11, 2026 at 8:37 am

    Removing width: 20px; from your .sub_floating_menu_item, height: 30px; from .sub_floating_menu, and replacing float: left; with display: inline-block; should fix the issue, little demo: little link.

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

Sidebar

Related Questions

Here is what I'm trying to achieve. I have 3 divs. Let's call them
I'm trying to create a <table> that doesn't exceed a certain width (let's say
What I want to do is to slide the content of the first div
Height of a div I'm trying to set the size of a div according
Hi I'm trying to understand how to make Dom elemnt, let's say div form
I've got this odd problem with jQuery. I'm trying to let the change of
Let's say i have a Domain Model that im trying to make compatible with
I'm trying to to fill a field with 11 numbers, but MySQL won't let
I have a problem with Facebook. Let me explain what I'm trying to do.
I'm trying to let users type in date and time values into an input

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.