Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with relative positioning 1

Status
Not open for further replies.

cactus1000

Programmer
Aug 31, 2001
149
US
I have a transparent gif (it's a giant letter "S"). This gif needs to be positioned so that the edge of the gif overlaps some text, creating the appearance that the text is right next to the letter in the center of the gif.

The positioning needs to be the same regardless of how the window is sized, etc., so absolute positioning is out.

I'm sure there's a way to do it with relative positioning, but so far I haven't found a way.

Any suggestions?
 
<img src=&quot;whatever.gif&quot; style=&quot;positioning:relative;right:?;top:?;&quot;>
You could use left or bottom instead if you wanted.
 
Or you could just put the image beside the text as you normally would but put a negative margin on it so it pulls the text into the image.
You can change the margin on either the image or the text

p.overlap { margin-left: -1em }
etc


É enzo@endamcg.com
 
Well, I tried both suggestions, but I still can't get the image to overlap the text. Here's the line in question:

<p><a NAME=&quot;specialprograms&quot;></a><img src=&quot;s.gif&quot;>pecial Programs and Areas of Concentration</p>

Any ideas?


 
It works fine for me like this.

<p><a NAME=&quot;specialprograms&quot;></a><img src=&quot;s.gif&quot;><div style=&quot;position:relative;left:30;bottom:30;&quot;>pecial Programs and Areas of Concentration</div></p>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top