Consider the following code snippet:
<div>
<p>blah blah</p>
<img src="...">
<p>blah blah</p>
</div>
Is there a way to align the img
element to either the right or left side of the screen, which may not necessarily be the same as the containing div's edge?
I am aware that there are various methods to achieve this by modifying the markup, but I am specifically looking for a solution with minimal changes to the existing markup. For example, using something like position: fixed; right: 0
while still keeping the element in the flow and maintaining its vertical position.