FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

using image behind text

 


Sparda
I was looking for a code that works well to have an image behind the text I tried one that worked but wasn't precise. Some of the text was off the image. Also, Firefox users could not see this image with the code I am using. Could I get a good code for my request?

~Thank you
badai
try floating div
Esch
As the previous poster stated, you can use a floating div to hold the text. Essentially, you're going to want to set both the div and the image to position: absolute, then use top, left, etc. to position them in relation to each other. Use the z-index property to specify which one should come in front (the larger the z-index, the "higher" the element is in the stack -- e.g. an element with a high z-index will hide an element with a low z-index below it).

Your code might look something like the following:
Code:
<img src="myimage.jpg" style="position: absolute; top: 5px; left: 5px; z-index: 1" />

<div style="position: absolute; top: 8px; left: 8px; width: 200px; z-index: 5;">here is some text that should float above the image</div>

With this method, you can place both text and images as precisely as you like. I hope that helps.
varun_dodla
I suggest you go with the above suggestion but instead of using inline style sheets it is always advisable to use external style sheets in order to separate the actual html from the styling.
Good luck !!
fadirocks
I'm not sure why you're doing that in the first place
but if you use Macromedia Fireworks you can create hotspots easily and will code everything right Smile

here is an example I made
http://www.buasda.com
it looks kinda cheezy but heh if they're happy then that's all what i care about
P.S. on this site i used slices instead of hotspots it worked better for me Shocked
qscomputing
HTMLGoodies.com did a tutorial on this a while back - have a look there.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.