background resizing

I'm in the process of creating a forum in JSC 2 and I'm having some issues with the background image(s). How can I get a background image to resize with the height of the page.

For example. In a forum you never know how long each page will be even if you set the pagination to 10 posts per page. Some users might be long winded. So one page could be twice as long as another. How can I get the background (whether it is an actual background image in the properties of the page, or using a picture to simulate a background) to know how long the table will be and make the backgrounds fit the height of the page?

I could be going about this in the wrong way. Suggestions on how others do backgrounds would be greatly appreciated and if you can show examples that would be better. Thanks!

[806 byte] By [Dtbonea] at [2007-11-26 15:30:57]
# 1

One way to do it would be to set the style of your body tag to "margin: 0px" and add this code to the top of the jsp page:

<div style="width: 100%; height: 100%; left: 0px; top: 0px; position: absolute; z-index: 0;">

<img src="loginbg.jpg" style="width: 100%; height: 100%;"/>

</div>

jsra at 2007-7-8 21:47:44 > top of Java-index,Development Tools,Java Tools...
# 2
where do I add that code? in between what tags? Putting it at the top only produces and error.Thanks!
Dtbonea at 2007-7-8 21:47:44 > top of Java-index,Development Tools,Java Tools...
# 3

I was able to get your code to work, however it has the same problem as setting a background in the design view of creator2. The background looks great as long as the page doesn't go longer than 100%. My problem is that I have tables which display messages and they go longer than 100% of the page. This leaves the 100% range of the background. Is there anyway to get a backgrond image to tile or fill in the entire page that is being shown without using a height parameter of greater than 100%?

If you have greater than 100% in the page, it makes the page too long for when the table might be short.

I don't have this problem for width because the page fits without needing a scroll bar for the x axis. But since tables can be dynamic depending on what is in the database, a longer page is sometimes needed and the background needs to adjust accordingly. Please help!

Dtbonea at 2007-7-8 21:47:44 > top of Java-index,Development Tools,Java Tools...
# 4
If you set the backgroung of the body element you might get what you're after...
yossariana at 2007-7-8 21:47:44 > top of Java-index,Development Tools,Java Tools...
# 5
Did you try the ImageURL property for the body1 component of your page? It doesn't work either?Message was edited by: sd4139Oops, never mind. This is why I should refresh the page before posting :-)
sd4139a at 2007-7-8 21:47:44 > top of Java-index,Development Tools,Java Tools...
# 6

Putting the url for the background picture simply adds the background picture again in design view. One thing I notice with the background in the design view, is that it scales properly height-wise but now it doesn't scale properly width-wise.

Is there a way to add "width: 100%" to a background image? As it is now, it just tiles, which is good for my y-axis.

Dtbonea at 2007-7-8 21:47:44 > top of Java-index,Development Tools,Java Tools...