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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:04:50+00:00 2026-05-17T22:04:50+00:00

In this question someone was having a layout problem because they had two floated

  • 0

In this question someone was having a layout problem because they had two floated divs inside a non-floated div. I suggested adding float: left to their outer div, which does fix the problem. Someone else suggested adding overflow: hidden, which to my surprise, also worked.

This doesn’t seem at all like the purpose of of overflow: hidden. Clearly overflow: hidden causes elements to view their children differently somehow. What I’m really trying to understand is what that difference is. Intuitively it should only make the element smaller than it would otherwise be, never bigger and I don’t see why it would affect the layout hierarchy.

Can anyone explain why this would be correct/necessary behavior or if this is just a browser quirk? Is their another facet to the overflow property I’m missing? Is either solution any better than the other?

Edit: I’ve discovered setting overflow: auto works too, so it doesn’t seem to be the value of overflow that’s important, just that it’s set. I still don’t understand why.

  • 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-17T22:04:50+00:00Added an answer on May 17, 2026 at 10:04 pm

    Overflow of anything but visible creates a new block formatting context which causes floats to be contained. It’s standard behaviour.

    Floats, absolutely positioned
    elements, inline-blocks, table-cells,
    table-captions, and elements with
    ‘overflow’ other than ‘visible’
    (except when that value has been
    propagated to the viewport) establish
    new block formatting contexts.

    In a block formatting context, boxes
    are laid out one after the other,
    vertically, beginning at the top of a
    containing block. The vertical
    distance between two sibling boxes is
    determined by the ‘margin’ properties.
    Vertical margins between adjacent
    block boxes in a block formatting
    context collapse.

    In a block formatting context, each
    box’s left outer edge touches the left
    edge of the containing block (for
    right-to-left formatting, right edges
    touch). This is true even in the
    presence of floats (although a box’s
    line boxes may shrink due to the
    floats), unless the box establishes a
    new block formatting context (in which
    case the box itself may become
    narrower due to the floats).

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

Sidebar

Related Questions

In a comment on this answer to another question , someone said that they
In this question someone asked for ways to display disk usage in Linux. I'd
In this question someone replies You never let the domain object implementations call services
As a follow-up to this question I am hoping someone can help with the
This is an adapted version of a question from someone in my office. She's
I saw this tip in another question and was wondering if someone could explain
Title is the entire question. Can someone give me a reason why this happens?
Ok, this is bit of an obscure question, but hopefully someone can help me
I was having problems getting a null layout manager working, and I found this
My question is similar to this one but I'm having some problems with the

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.