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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:35:44+00:00 2026-05-25T17:35:44+00:00

i have for example five divs, that has float:left and they are wrapped inside

  • 0

i have for example five divs, that has float:left and they are wrapped inside div, that has display:inline-block and width:auto. So result is one row with 5 divs and that row has width = sum of childs, because width:auto on div, that has display:inline-block results in width to fit content.
Then i have all wrapped inside div, that has width = width of one of that 5 divs and overflow:hidden, so only one of that 5 divs is visible.
But problem is, that 5 divs is not now in row, but is in column, because their parent is wrapped inside div with width = width of one of that 5 divs.
I need animate margin-left on first of that 5 divs, so the next div becomes visible. But when that divs are in column and not in row, the look and feel while animating is not what i want.
So how make something like this:

 ------1-------
 | -----------|---------2----------
 | | ----3--- | -----3-- --3----- |
 | | |      | | |      | |      | |
 | | |      | | |      | |      | |
 | | -------- | -------- -------- |
 | |          |                   |
 | -----------|--------------------   
 --------------

Only 1 must be visible.
1 has width = width of 3 and overflow: hidden, so only first of 3 is visible.
2 has display:inline-block and width:auto, so its width fit content.
3 has float left or display:inline-block.

Problem is when i wrap 2 into 1, then width of 2 is not to fit conent, but is width of 1 and becomes column and not row.

<div-1 style="overflow:hidden;width:64px;height:64px">
  <div-2 style="display:inline-block;width:auto">
     <div-3 style="width:64px;height:64px;float:left"></div>
     <div-3 style="width:64px;height:64px;float:left"></div>
     <div-3 style="width:64px;height:64px;float:left"></div>
  </div>
</div>

Div-2 is row, but when i wrap it inside div-1, it becomes column and that is what is unexpected.
Sorry for my english.

  • 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-25T17:35:44+00:00Added an answer on May 25, 2026 at 5:35 pm

    First you should add clearfix to the div2 if you are floating its contents.

    You could calculate the width with

    var width = $('.div2').innerHeight();

    $('.div2').css('width', width);

    Here an example, set the .div1 { overflow: visible} to see the result:

    http://jsfiddle.net/karameloso/Apz7B/

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

Sidebar

Related Questions

In this hypothetical example, imagine I have an object FooSet that has five properties
I have a tab bar controller with five buttons. That controller has a tab
I have an example of some code that I see often in websites that
I have an example function below that reads in a date as a string
I have created a WinForms user control that is a set of five cascading
I have five text files that are produced by an R program, (each of
I have an Observable sequence that produces events in rapid bursts (ie: five events
I have a ArrayList with five Numbers, for an example 1,2,3,4,5. Same number can
Let's say I have five or more input computers that can affect whether a
I have some vectors of experimental data that I need to massage, for example:

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.