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

div code to overlay a picture anywhere you want.

 


fruitcakelyts
I need a code that includes a place for your picture's URL and alterable placement numbers. Thanks!
LukeakaDanish
1: use an <img> instead of a <div> - that way you have the src to provide the url.

2: Use style="position: absolute; top: 100px; left: 100px;" to place the image 100 pixels from the top left corner. You can also (but not at the same time!) use the right and bottom attributes.

If you don't want the images to go "on top" of everything else, add style="position: relative; z-index: 2;" to anything you want to be on top of the images.
Aredon
You could still use the div tag if you did style="position: absolute; top: #px; left: #px; background-image: url('../image/location/rawr.gif');" Then you'd also have to define height and width for the div, unless you used background-repeat: no-repeat. A background-image div should always have height and width defined though in my opinion. Smile
LukeakaDanish
Aredon wrote:
You could still use the div tag if you did style="position: absolute; top: #px; left: #px; background-image: url('../image/location/rawr.gif');" Then you'd also have to define height and width for the div, unless you used background-repeat: no-repeat. A background-image div should always have height and width defined though in my opinion. Smile


Doing it that way would be very backwards though Smile
Aredon
LukeakaDanish wrote:
Aredon wrote:
You could still use the div tag if you did style="position: absolute; top: #px; left: #px; background-image: url('../image/location/rawr.gif');" Then you'd also have to define height and width for the div, unless you used background-repeat: no-repeat. A background-image div should always have height and width defined though in my opinion. Smile


Doing it that way would be very backwards though Smile

Ehh that really depends, some people prefer it that way so they can have the image declared in a separate CSS file and just drop classes elsewhere on the site when they want the image.
LukeakaDanish
That's still backwards Smile

Also it's bad for SEO, makes "copy image" stop working in the browser, and highly counter intuitive if you read the source.
Marcuzzo
fruitcakelyts wrote:
I need a code that includes a place for your picture's URL

you mean like an external file that holds the URL's of the pictures?

fruitcakelyts wrote:
and alterable placement numbers. Thanks!

Lika an Array that shifts the position of the items?

please be more specific in what you need.

cheers
fruitcakelyts
LukeakaDanish wrote:
1: use an <img> instead of a <div> - that way you have the src to provide the url.

2: Use style="position: absolute; top: 100px; left: 100px;" to place the image 100 pixels from the top left corner. You can also (but not at the same time!) use the right and bottom attributes.

If you don't want the images to go "on top" of everything else, add style="position: relative; z-index: 2;" to anything you want to be on top of the images.


this is what i need but i would like the entire code. i cant put it together and make it work
Diablosblizz
Try this:

<img src="IMAGEURL.jpg" style="position: absolute; top: 100px; left: 100px; position: relative; z-index: 2;">
defecto
What about this code.. I use it alot when making div overlays for myspace layouts.



Code:


<div style="position:absolute;
 top:xxx; left:xxx;
 overflow:auto;
width:xxx;height:xxx;
 color:;
 font-size:9pt;
 font-weight:bold;
 font-family:arial;
 text-align:center;
 background-color:;
 background-image: url(image url goes here);
 background-position:center;
 background-repeat:no-repeat;
 border:0px solid silver;">
<br />



</div>






Hope this helps you or any others that could use the code.
Related topics

Free domains (dns/ip): you.bee.pl/orge.pl/bij.pl/345.pl
div -addressing doesn't work in IE?
DIV code to place text anywhere.
Center Picture
HTML tables with irregular rows and/or columns

Help for make a panoramic picture
Iframe
UBB Code / Smiley Parsing
Validation help needed
CSS - How to vertical center an object in CSS

Program for Templates?
CSS Help...
css background
Photo Shop tutorial: Trendy Lines
Center the site with the <DIV> tag.
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.