How would I position an image at the bottom of a div using JavaScript without wrapping it? I understand I can wrap it with a div and do absolute positioning, but that muddies up the markup and it’s dynamic content too, so I can’t wrap the image, it has to target an image in a specific div.
Here is the basic markup, need it to find height of div, then position image at bottom. i think that is how it would work?
<div id="content">
<p>some text</p>
<img src="img.jpg"/>
</div>
You can position an image as well to the bottom of a DIV, you don’t need to add a second wrapper.
Either do it in CSS:
or do the same thing in JS if you need it be in JS.