Note that there are some explanatory texts on larger screens.

plurals
  1. POGrow a div to the left
    primarykey
    data
    text
    <p>Is this even possible? The basic setup is a sidebar on the right with div elements in it. Clicking one of these elements would add a "popout" div, that should be displayed left of the clicked element. The popout contains a variable number of buttons. I'd like to style it using only CSS, so i can just add the correct HTML elements from my script and have the stylesheet do the layout.</p> <ul> <li>I've attepmted the popout inside the sidebar element, positioned absolutely, but then I cannot make the sidebar element itself scale to be at least as tall as the popout. (The sidebar elements are usually shorter in height than the popout).</li> <li>I tried putting the popout before the element, and using position absolute, but for some reason the popout will not get wider if i add more buttons, and instead overflows them downwards.</li> <li>Using position relative on the popout will make it leave empty space where it would have been in the sidebar.</li> <li>Floating it messes up the width of other sidebar elements.</li> </ul> <p>The sidebar is fixed width. The popout is fixed-height. The buttons are fixed-size. The sidebar elements are full-width but variable-height.</p> <p>I've lost track of all the different things I've tried. My closest attempt at the moment is in this <a href="http://jsfiddle.net/cUceH/2/" rel="nofollow">JsFiddle</a>, where the popout is positioned correctly, but does not grow leftwards, only overflow downwards. If I set the width to a large number, it will line the buttons up correctly, but it makes strange things happen if I add a :hover pseudo-class.</p> <p>How could this be done in HTML/CSS? Or is it only possible using JavaScript? If so, what could be a simple "out-of-the-way" approach of doing this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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