PDA

View Full Version : HTML question


Nathan
12-22-02, 08:51 PM
I'm pretty new to programming HTML. I have a question that should be pretty easy for lots of you to answer:

How do you make the background of a webpage (ie: jpeg image) resize automatically as you resize the browser window?

I know how to make the background "tile" automatically to fill the screen, but not simple resize (ie: no tiling).

Thanks!

DaveW
12-23-02, 09:08 AM
You can't.

But you can do it with layers. something like this may work:


<div id="bg" style="z-index:0; width:100%; height:100%; position:absolute">
<img src="mybackground.jpg" width="100%" height="100%">
</div>

<div id="fg" style="z-index:100; width:100%; height:100%; position:absolute">

<h1>Hello</h1>
page content goes here

</div>

stncttr908
12-23-02, 09:40 AM
Yes, the man is right. You can't do that with plain HTML unfortunately, you have to delve deeper into the barren lands of CSS...bloody hell. :(

Nathan
12-23-02, 04:20 PM
Thanks for the information!