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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:51:29+00:00 2026-05-23T08:51:29+00:00

Objective I have a main DIV with fixed height and width, and in that

  • 0

Objective

I have a main DIV with fixed height and width, and in that I want have lots of small DIV’s to float freely. I have more small DIV’s than can fit in the main DIV. Then it seems that by default is disappear small DIV’s down outside the main DIV. I want them instead to disappear to the right.

I want to trigger a horizontal scrollbar, but no vertical.

Background

I tested this with white-space: nowrap as described at http://www.webmasterworld.com/forum83/8844.htm

And it works perfect if I have only text or images in the main DIV.

Question

But how do I do when the main DIV contains only small DIV’s?

  • 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-23T08:51:29+00:00Added an answer on May 23, 2026 at 8:51 am

    Wrap your smaller divs in a third div that has a greater width than your main div like so. Assuming I understood your question correctly no jquery is needed.

    <html>
        <head>
            <style type="text/css">       
                .div_1
                {
    
                    height: 350px;
                    width: 350px;
                    margin: auto;
                    border: 1px black solid;
                    overflow-y: hidden;
                    overflow-x: scroll;
                }
    
                .div_3
                {
                    float: left;
                    height: 350px;
                    width: 500px;
                    margin: auto;
                    border: 1px black solid;
                    overflow-y: hidden;
                    overflow-x: scroll;
                }
    
                .div_2
                {
                    height: 100px;
                    width: 100px;
                    border: 1px solid #A2A2A2;
                    float: left;
                }
            </style>
        </head>
    
        <body>
            <div class="div_1">
                <div class="div_3">
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                    <div class="div_2"></div>
                </div>
            </div>
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning Objective-C on windows using GNUstep. I have a main class that looks
I have some Objective-C++ code that I'm trying to get events out of an
This is Objective-C, in Xcode for the iPhone. I have a method in main.m:
Hey guys. I have an app in Objective C (using xcode) that I would
Hey. i have a main layer that contains a 4 circle layers and inside
I have a C++ helper class that I use with objective-C. I would like
I have a somewhat messily-formatted Objective-C code base. Is there a way to have
Say I have the following Objective-C class: @interface Foo { int someNumber; NSString *someString;
I'm learning objective-C and Cocoa and have come across this statement: The Cocoa frameworks
We have a collection of commercial MFC/C++ applications which we sell using Stingray Objective

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.