Note that there are some explanatory texts on larger screens.

plurals
  1. POMake child visible outside an overflow:hidden parent
    primarykey
    data
    text
    <p>In CSS the <code>overflow:hidden</code> is set on parent containers in order to allow it to expand with the height of their floating children. </p> <p>But it also has another interesting feature when combined with <code>margin: auto</code>...</p> <p>If PREVIOUS sibling is a floating element, it will actually appear juxtapose to it. That is if the sibling is <code>float:left</code> then the container with <code>float:none overflow:hidden</code> will appear to the right of the sibling, no newline - just as if it was floating in the normal flow. If the previous sibling is <code>float:right</code> then the container will appear to the left of the sibling. Resizing this container will accurately show it centered inbetween the floating elements. Say if you have two previous siblings, one <code>float:left</code> the other <code>float:right</code>, the container will appear centered inbetween the two.</p> <p>So here's the <strong>problem</strong>...</p> <blockquote> <p><strong>How do I maintain that type of layout WITHOUT masking children?</strong></p> </blockquote> <p>Googling all over the web gives me ways on how to <code>clear:both</code> and expand a container... but I can't find any alternative solution to maintaining the left/right previous-child centering. If you make the container <code>overflow:visible</code> then the container suddenly ignores the layout flow of the floating elements and appears layered ontop of the floating element.</p> <p>So <strong>question</strong>:</p> <p>I have to have the container <code>overflow:hidden</code> to preserve layout... </p> <p>how can I make it so the children aren't masked? I need to have the child absolutely positioned relative to the parent outside the container.</p> <p>OR</p> <p>How do I <code>overflow:visible</code> so I can absolutely position a child relative to the parent outside the container... YET preserve the sibling float-like-layout-flow?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload