Prevent div from dropping down when browser window is resized smaller

Posted on 2011-10-12
Last Modified: 2012-05-12
I have a div that is "dropping" down under the div it is next to when the browser window gets too small:

(the red box represents the browser window)

 div drops down
Question by:knowlton
    LVL 30

    Assisted Solution

    Can you post your code or a live URL?  This generally happens when there is no container with a set width. You will need a container of some kind with a width set in order to achieve what your doing.
    LVL 82

    Assisted Solution

    by:Dave Baldwin
    When you try to 'float' a div and there isn't enough room, it will do that.
    LVL 16

    Accepted Solution

    You need specify min-width of body, or make wrap for example red div and specify min-width to it.
    LVL 5

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    "I want to put my photos online, but I don't want them stolen.  What settings should I use?" When You Put Photos Online First and foremost, any digital file published on the WWW can be copied, stored, modified, retransmitted, etc.  Remember Naps…
    As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
    In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
    In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now