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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:12:31+00:00 2026-06-14T20:12:31+00:00

How to create set of float:right divs one next to another and make them

  • 0

How to create set of float:right divs one next to another and make them not wrap, no matter how much of them exists or how wide is any of them. If they together are wider than viewport, then x-scroll should appear.

Content inside those divs should wrap normally.

CSS only would be good.

  • 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-14T20:12:32+00:00Added an answer on June 14, 2026 at 8:12 pm

    Style the parent element with white-space: nowrap;, though this only works with display: inline (or display: inline-block;) elements. Given the following HTML:

    <div id="parent">
        <div class="child"></div>
        <!-- there's quite a lot of these... -->
        <div class="child"></div>
    </div>
    

    And the CSS:

    #parent {
        white-space: nowrap;
    }
    
    #parent .child {
        display: inline-block;
        /* there's some other CSS for aesthetics */
    }
    

    JS Fiddle demo.

    Unfortunately I don’t think there is a way of forcing float-ed elements to not wrap to a new line.

    To preserve or, rather, force normal line-wrapping for descendant elements you’ll have to explicitly over-ride the inheritance and set white-space: normal (as well as, possibly, define a width or max-width)

    /* other CSS remains intact */
    
    #parent .child {
        display: inline-block;
        /* irrelevant/aesthetic CSS */
        white-space: normal;
        max-width: 8em;
    }
    

    JS Fiddle demo.

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

Sidebar

Related Questions

I'm trying to create this set of social icon to float to the right
I want a layout with two right-aligned columns. So, I create the three divs
I need to create a one-lined 3-column layout. The left and right columns should
I would like to create set of strings and below is the only limitation.
We create a Set as: Set myset = new HashSet() How do we create
I want to create a set of options, that will be appended to every
I want to create a set of classes that are very similar and can
I'm trying to create a Set that contains instances of 'Vertex3<T>'. I'm having a
I am attempting to create a set of folders that comes in from a
I'm trying to create a set of checkboxes that I can check and send

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.