Expressing this may be a challenge, but I'll give it a shot. Within a div, there is text that can vary in length based on user input.
My goal is to have the ability to insert an image in one of several positions, determined by the selection made in a dropdown menu:
Above the text
Below the text
To the left of the text
To the right of the text
I'm curious if there's a simple way to maintain the same structure in the markup, like so:
<img src="">
<span>Text</span>
And then use CSS to adjust the position of the image accordingly. It's worth noting that the dimensions of the text are variable, making it impractical to rely on specific pixel measurements.
If feasible, I would prefer not to resort to using javascript for this purpose.