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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:32:20+00:00 2026-06-03T04:32:20+00:00

I am trying to float divs horizontally, however its falling into a new line.

  • 0

I am trying to float divs horizontally, however its falling into a new line.

http://jsfiddle.net/nyCrY/4/

It works only if I set width of the #holder higher than its content.

Is there a way to do this without setting the fixed width on #holder?

Thank you!

  • 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-03T04:32:21+00:00Added an answer on June 3, 2026 at 4:32 am

    Not really with pure CSS.

    You can use a static width (which you don’t want to do), you can use floats + whitespace (which is unreliable), or you can dynamically calculate the necessary width with javascript and set the style’s width to that number.

    According to this tutorial: http://css-tricks.com/how-to-create-a-horizontally-scrolling-site/

    I spent some time playing with the float property and the white-space
    property to see if I could find a way to fight browser auto-wrapping,
    but I didn’t have much luck. Page elements which are floated but do
    not have a width exhibit a property where they expand to the width of
    the content inside them. I thought perhaps if I put a bunch of float
    elements inside of that, it might just keep expanding beyond the width
    of the browser window. No dice. There is also a white-space: nowrap;
    property in CSS which I thought might be able to be exploited to fight
    the auto-wrapping, but it only works for text elements, not blocks or
    just any old thing you set to inline. Oh well.

    So, he basically is saying, no its not possible with just css.

    But he goes on to say that you can do some javascript magic to achieve it:

    JavaScript clearly has the ability to manipulate page elements and do
    calculations on-the-fly.

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

Sidebar

Related Questions

I am trying to give float point into core-plot y axis value, it is
I'm trying to get two divs to float to opposite sides of the page,
I am trying to place two divs next to each-other on the same line,
I'm trying to accomplish a layout like the one below: Two float:left divs are
Please see the fiddle below to see the code and result: http://jsfiddle.net/jhacks/nnZWB/7/ I am
I have this basic scenario setup where I am trying to float divs inside
i'm trying to split two divs into two section, left and right. With the
I'm trying to get 2 divs on the same line, I've got <div class=header>
I'm trying to create two divs side by side. I tried to put float:
I'm trying to convert std::string to float/double . I tried: std::string num = 0.6;

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.