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 have some Objective-C code that looks like this: #define myVar 10 float f
Can a Objective c interface have more than one implementation? Example I could have
Suppose I have a div element with height: 150px and width:300px . Is it
I'm learning Objective-C on windows using GNUstep. I have a main class that looks
This is Objective-C, in Xcode for the iPhone. I have a method in main.m:
I have an objective-c application for OS X that compares two sqlite DB's and
I am writing a simple console application in Objective-C but I have heard that
I have two activities one displaying map view and another listview, the main objective
In my game in objective c, I have two classes, The main ArcherClass and
I have a 64-bit-only application that I am developing in Objective-C on Cocoa. It

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.