I have to create a div that should look like
<div id=1>
<img></img>
<div id=2></div>
</div>
the div with id 2 should appear at bottom-right corner of image, and the size of image is not fixed what should be the css applied to div with id=2
div with id =1 has no position defined so uses default and same is with image and i cannot change these
only div with id=2 is editable to me. Please suggest something
If you cannot edit the CSS for div #1, you’re sort of screwed.
If you could just add
{position:relative}to that div, you’d be in business. Absolute positioning will target the first parent with ‘Relative’ positioning. Since the default ofdiv 1is ‘Static’…Positioning won’t work.‘Float’ might work,
div 2would technically need to come beforediv 1– thus causingdiv 1to inherit the float ofdiv 2; however, that would also stack your image atopdiv 2rather than below it. … So Float is out as well.IF you can add CSS to
div 1anddiv 1 img, then an easy fix is this:Good luck…