Hey there, take a look at the image below https://i.sstatic.net/zYiaY.png
The issue I'm facing is quite common - I have div 1 and div 2 visible in a loop, but divs 3 are hidden. When div 2 is clicked on, everything is great so far. However, what I want is for div 3 to adjust itself to the best available position, whether that be to the right, top, or bottom if there's no space on the left side. Essentially, I want it to auto-adjust like the title of something in default settings.
https://i.sstatic.net/ihVSr.png
Please disregard the colors. What I've attempted is something like this:
<div> // div1
<div> //div2
<div class='div3'> //div 3
</div>
</div>
</div>
CSS
.div3 {position:absolute;right:0px;}
I would appreciate any suggestions or insights on this matter.