i have to divs one is main div one is bottom div
there are properly working in interner explorer,
but there are overlapping in mozilla firefox

Dani AI

Generated

Browsers render flow differently when an element does not establish its own layout context. Since has not posted markup, try these proven fixes and quick checks that go beyond the general hints from and .

Try one of these fixes on the parent container (choose one, not all):

/* modern: creates its own block formatting context */
.container { display: flow-root; }

/* classic clearfix */
.container::after {
  content: "";
  display: table;
  clear: both;
}

/* overflow hack (works but may add scrollbars) */
.container { overflow: auto; }

/* if children are positioned absolutely, anchor them */
.container { position: relative; }

If floats are used, the clearfix or flow-root will make the parent wrap its children; overflow:auto also forces a BFC but can clip content. If absolute positioning is in play, ensure the parent is the positioned ancestor so siblings do not overlap.

Troubleshooting steps: open Firefox Inspector, select the container and check computed height, float, position, and overflow; toggle each fix to see which removes the overlap. If those do not help, post a minimal reproducible example (only the HTML and the CSS that affects the two divs). Background reading: Block formatting context and overflow. For the common clearfix pattern see CSS-Tricks clearfix.

Recommended Answers

All 5 Replies

Show your codes.

If it doesn't fit, IE shoves stuff out of the way, Mozilla overlaps them.

The problem is that they don't fit the available space.

do you use floating elements for both divs? if yes, then you might forget about the clearing one.

The 'overflow' control how to display the overflow contents. The contents can be overflow out it's parent or neighbor elements by floating, negative margins or absolute position.

Member Avatar for Member #120589

Let's all wait until he posts his markup and css. His first post - let's see if he follows up. Not holding breath.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.