DEVILofDARKNESS Posted September 14, 2009 Share Posted September 14, 2009 How can I make an image auto-resize on the background I mean: If someone uses an other screen, he needs to see the same as I see on my lil laptop screen What do I need for this? Quote Link to comment Share on other sites More sharing options...
saltedm8 Posted September 14, 2009 Share Posted September 14, 2009 I cant guarantee it would work, but try adding width:100%; in the css Quote Link to comment Share on other sites More sharing options...
DEVILofDARKNESS Posted September 14, 2009 Author Share Posted September 14, 2009 Okay that probably will work, but is that a good way, because on large screens maybe the image will be ugly resized? Quote Link to comment Share on other sites More sharing options...
saltedm8 Posted September 14, 2009 Share Posted September 14, 2009 no, it wont be ugly because height is not defined it should stay in proportion.. although there is a possibility the image quality goes down with larger screen sizes.. unfortunately, short of being able to detect a screen size and using php to swap the image with another, I see no other way... I don't even think its possible to detect screen sizes Quote Link to comment Share on other sites More sharing options...
DEVILofDARKNESS Posted September 14, 2009 Author Share Posted September 14, 2009 background-image: url('../atomic.jpg'); background-repeat: no-repeat; background-width: 100%; De laatste werkt niet aangezien background niet met width werkt :s Quote Link to comment Share on other sites More sharing options...
saltedm8 Posted September 14, 2009 Share Posted September 14, 2009 I don't know then mate, I have never tried it myself, my reply was just a guess Quote Link to comment Share on other sites More sharing options...
DEVILofDARKNESS Posted September 14, 2009 Author Share Posted September 14, 2009 I solved it! css: #background_image { position: absolute; top: 0px; left: 0px; height: 100%; width: 100%; z-index: -1; } html: <img src='./test/atomic.jpg' id='background_image'> Quote Link to comment Share on other sites More sharing options...
saltedm8 Posted September 14, 2009 Share Posted September 14, 2009 sweet.. nice work Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.