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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 2 different pics for background??

Status
Not open for further replies.

mockler

Programmer
Aug 16, 2002
15
CA
Hello,

I have looked up how to put on a background picture so that it isn't tiled etc. (using css), but now my user wants to see if I can put the 1 picture on the background (only once), but also put another desgin (tiled) in the background as well.

Can you put two different pictures in the background?? if so, how??

Thanks,

-andrew
 
Set the tiled image how you normally would, then do this for the other:
<div style=&quot;position:absolute;top:0;left:0;filter:alpha(opacity=50)&quot;;z-index:0;&quot;>
<img src=&quot;the_untiled_image&quot; width=&quot;100%&quot; height=&quot;100%&quot;>
</div>
 
>>Can you put two different pictures in the background??
Impossible.

But you can make nested tables, each one with different background image and it's settings:

<table>
<tr>
<td background=&quot;one.gif&quot;>

<table>
<tr>
<td background=&quot;two.gif&quot;>
c o n t e n t
</td>
</tr>
</table>

</td>
</tr>
</table>
 
Hey RISTMO,

That worked, but I do have a problem. I can't get the picture to be align at the bottom of the page. It only aligns at the bottom of the window?!?! (know what I mean?) Say, a user has their window 480x640, the picture looks like it's at the bottom, but the user has to scroll the window and the picture scrolls with it. I can't stop it. If I replace &quot;absolute&quot; with anything else the picture no longer becomes faded. And I do have &quot;bottom=0; left=0&quot;.

Any help??

thanks.
 
Try switching them. Put that picture in the background for the doc and set the scrolling stuff, then stick the tiled image here:


<div style=&quot;position:absolute;top:0;left:0;filter:alpha(opacity=50)&quot;;z-index:0;width:100%;height:100%;background-image:url('pic.gif');&quot;>
&nbsp;
</div>

Rick
 
That didn't really work either. The picture that I am puting in the >div> tag (which would now be the tiled background) still only shows on the screen relative to the size of the window, not the entire page!!

Have you done a background with two pics before?(RISTMO)
'

maybe this can't be done.

The code that I have for my background things are:

<head>
<style type=&quot;text/css&quot;>body { background-color: #D1CEA3; background-image: url('FerryHalifax-light4.jpg');
background-repeat: no-repeat; background-attachment: scroll; background-width: 100%;
background-position: bottom 0 }
</style>
</head>

<body bgcolor=&quot;#D1CEA3&quot;>

<div style=&quot;position: absolute; top: 0; left: 0; filter: alpha(opacity=50); z-index: -1; width: 100%; height: 100%; background-image: url('background-Logo3.jpg')&quot;>
</div>

blah blah blah

</body>

makes sense to you??

-andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top