Div over an Image?

How can I change the position of DIV over an image ?

One way is to add position: relative; to your image and then abosolute position the div according to it.

1 Like

can u plz help with a sample code ?

1 Like

<img src="someimage.png" alt="alternative text" style="position: relative;" /><span style="position: absolute; top: 50px; left: 50px;">Some text..</span>

1 Like

That won’t work as the div is not inside the image. Absolute positioning is relative to the nearest positioned parent.

Why not have the image as a background to the div?

Not sure if this applies; I needed a div to appear over a web page to ‘ghost’ down the background and then have another centred within this that contained the ‘pop-over’ content (see CRF printing and click the Callback link), is this similar to what you are trying to achieve?

Hi priyakochin,

>>> How can I change the position of DIV over an image ?

Can you explain what you want without using terms such as DIV and image.

There may be alternative solutions of what you want positioned on the webpage.

Ah okay, my bad :slight_smile: