I made myself a little background image for one of my pages in Photoshop and saved it for web at 1024×768. does anyone know if there is a code in CSS so that I can have that bkgrnd image stretch to fit the webpage it is loaded up on? thanks!
I made myself a little background image for one of my pages in Photoshop and saved it for web at 1024×768. does anyone know if there is a code in CSS so that I can have that bkgrnd image stretch to fit the webpage it is loaded up on? thanks!
You can try this, it worked when i tried.
Comment by JCQuiridumbay — October 16, 2009 @ Friday, October 16, 2009 3:45 pm
This is tricky but totally possible. I put up an example demonstrating here:
http://understandingnewmedia.com/webpro/examples/background_fixed_example.html
One thing to note is that this won’t work on ie6 or less. There is a workaround but I’m already throwing some slightly more advanced CSS at you here so lets wait on making it bullet proof. The important things happening here are fixed positioning and setting the z-index. We will go over this in detail in a couple weeks but you’re welcome to work ahead.
Comment by joe — October 16, 2009 @ Friday, October 16, 2009 4:35 pm
Wow this post is really cool. Thanks joe for the cool example and thanks adam for the interesting post
Very helpful
Comment by adnan — October 19, 2009 @ Monday, October 19, 2009 8:42 pm