I need a code that includes a place for your picture's URL and alterable placement numbers. Thanks!
div code to overlay a picture anywhere you want.
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.
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.
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. 
| 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. |
Doing it that way would be very backwards though
| LukeakaDanish wrote: | ||
Doing it that way would be very backwards though |
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.
That's still backwards
Also it's bad for SEO, makes "copy image" stop working in the browser, and highly counter intuitive if you read the source.
Also it's bad for SEO, makes "copy image" stop working in the browser, and highly counter intuitive if you read the source.
| 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
| 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
Try this:
<img src="IMAGEURL.jpg" style="position: absolute; top: 100px; left: 100px; position: relative; z-index: 2;">
<img src="IMAGEURL.jpg" style="position: absolute; top: 100px; left: 100px; position: relative; z-index: 2;">
What about this code.. I use it alot when making div overlays for myspace layouts.
Hope this helps you or any others that could use the code.
| 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
