View Full Version : locate image on page
questions
08-09-2008, 02:28 AM
I'm all questions today...
Is it possible to locate an image through a "div style" tag next to the image?
Example (in BODY of page):
<div style="top: 200px;"><img src="ai-board1.jpg"></div>
This didn't work for me.
THANKS.
rangana
08-09-2008, 02:37 AM
It did work for me:
<div style="top:200px;">
<img src="http://h1.ripway.com/rangana/images/Picture4.jpg"></div>
Please provide a link to the page in question.
questions
08-09-2008, 02:39 AM
I had to do this for it to work:
<div style="margin: 200px;">
Don't know why...
mburt
08-09-2008, 02:55 AM
The "top" attribute only does anything if the "position" attribute is set as well (for example, "position: absolute" or "position: relative").
questions
08-09-2008, 03:20 AM
The "top" attribute only does anything if the "position" attribute is set as well (for example, "position: absolute" or "position: relative").
Right! Thanks!
Medyman
08-09-2008, 04:28 PM
I had to do this for it to work:
<div style="margin: 200px;">
Don't know why...
So you were trying to add 200px between the top of the div and the image? If it's the image that you're aligning, you should generally add the styles to the image. In this case, it would be something like:
<div id="container">
<img src="image.jpg" alt="image">
</div>
#container {
position:relative;
}
#container img {
position:absolute;
top:200px;
}
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.