Jump to content

Div


DaNuGai

Recommended Posts

I have a website where the Main table is aligned center, so my website looks has format smiliar to the following website: http://www.oswd.org/Now I want to insert a DIV tag and position it over an image and at a certain place on that image. Now depending on screen resolution the images aligns differently since it is centered but the DIV tag is position by pixels.I would really appreciate if someone can help me with this issue. I would like to be able to add a DIV tag on an image and position it relative to the image.

Link to comment
Share on other sites

If I understand correctly, you are trying to position an item in a div over an image. The trick here is to place the image in its own div with relative positioning, then the div that you are positioning over with absoute. The 2nd div will always position itself absolutely relative to its parent. Did that make any sense? Refer to this site for a clearer definition: http://www.autisticcuckoo.net/archive.php?...tively-absoluteWell give this a try and see if it does what you want

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">	<div style="margin:0 auto;width:600pt">		<div style="position:relative">			<img src="xxx.jpg"/>			<div style="position:absolute;top:10pt;left:10pt;background-color:gold">my text</div>		</div>	</div>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...