Forum Moderators: open

Message Too Old, No Replies

Setting backgrounds to 100%

         

meetmatt03

6:22 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



Hi everyone, thanks for reviewing this question ...

I'm wondering is there any way to set a background image's relative width and height? I have an iframe in the middle of my page that is set on a certain % width and height and I want the background image of the cell that the iframe is in to have the same dimensions. The iframe is set on transparent so that the cell's background image shows through to the iframe. I'm not sure if it's possible, but could I set a regular image with those dimensions and then somehow place the iframe right on top of the image? Or, does anyone have any suggestions of alternate ways to achieve this? Thanks so much ...

oilman

6:25 pm on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld meetmatt03 - here's a thread all about background images and css: [webmasterworld.com...]

meetmatt03

6:39 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



Okay, I think my best bet lies in CSS as described by the message in that link:

____________________________________
Is there a way to put things like a table or text over top of an IMG SRC image?

Yes, with CSS.

Use the z-axis and absolute positioning for 2 divs, giving each one a unique id ("#"). You can place one div over top of the other in the exact same spot. Then, in your bottom div you can use the browser to re-size the image right in the <img> tag.

However, you said you have thousands of background images. Are they all the same dimensions, or at least do they fall into only handful of sizes? If not, writing code that figures out what the doubled dimensions are will also be a challenge.

...set the size of the table using table width and td height

Browsers "may" take those settings into account as suggestions, but the final size when the table and cells are actually rendered will still vary according to several other factors. That's what makes this approach so daunting.
____________________________________

I have no idea how to use CSS though, but I think I can catch on pretty quickly. Would it be possible to show me an example of a page as described above so I could just modify it?

oilman

6:42 pm on Jun 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Matt - one of our mods Nick_W put together a great crash course on getting started with css - here's the table of contents: [webmasterworld.com...]

meetmatt03

8:02 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



Hey, not to be a big bother, but do you think you could help me with this part?

____________________________________
Is there a way to put things like a table or text over top of an IMG SRC image?

Yes, with CSS.

Use the z-axis and absolute positioning for 2 divs, giving each one a unique id ("#"). You can place one div over top of the other in the exact same spot. Then, in your bottom div you can use the browser to re-size the image right in the <img> tag.
____________________________________

I've tried a bit but I didn't see anything in the tutorial about the z-axis and I'm still not quite sure what to do. Thanks so much ...

meetmatt03

8:11 pm on Jun 6, 2003 (gmt 0)

10+ Year Member



Oh! Hey, I think I got it actually! Well thanks for your help :)