kanch33 Posted July 14, 2009 Share Posted July 14, 2009 Hello All! Thanks for your help... I am fairly new to dreamweaver and even newer to CSS. Basically I have a fairly simple website that I'm working on... currently the background is an image thats 2000X1500 (widthxheight) Now on my 24" mac screen it looks great and fits the browser window perfectly but on a smaller screen or on PCs it looks terrible. I really need to find a way with HTML or CSS that I can adjust the size of the background image to the size of the users' browser window or resolution... I am happy to loose a bit off the right hand side (with the image aligned left) in order to maintain the aspect ratio Help much appreciated thanks! my html for the background is currently: background-image: url(images/sitebackgroundweb.jpg); background-repeat: no-repeat; Quote Link to comment https://forums.phpfreaks.com/topic/165948-help-needed-with-scaling-a-background-image-to-fit-browserresolution/ Share on other sites More sharing options...
rhodesa Posted July 14, 2009 Share Posted July 14, 2009 What you want to do is slice it up so it repeats and can stretch accordingly. can you post the image? Quote Link to comment https://forums.phpfreaks.com/topic/165948-help-needed-with-scaling-a-background-image-to-fit-browserresolution/#findComment-875249 Share on other sites More sharing options...
xtopolis Posted July 15, 2009 Share Posted July 15, 2009 Can't he just apply the background-position declaration and align it? If I remember correctly, if it's too big the excess won't be shown. The downside would be that it loads the huge image regardless of screensize. Quote Link to comment https://forums.phpfreaks.com/topic/165948-help-needed-with-scaling-a-background-image-to-fit-browserresolution/#findComment-875527 Share on other sites More sharing options...
noober Posted July 23, 2009 Share Posted July 23, 2009 I don't mean to come off as sounding harsh but scaling/resizing an image based on screen resolution is sophomoric and just plain bad practice. Consider tiling an image or another solution. Quote Link to comment https://forums.phpfreaks.com/topic/165948-help-needed-with-scaling-a-background-image-to-fit-browserresolution/#findComment-881560 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.