WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > How to make images resize automatically?

Reply
  Thread Tools Display Modes
Old 11th June 11, 11:27 PM   #1
Abby
WLC Member
 
Join Date: Jun 2011
Posts: 1
Default How to make images resize automatically?

<style>
#Picture {position:fixed; bottom:0; z-index:100;}
</style>

<div id="Picture">
<img src="picture.png">
</div>

On smaller screens it will be too wide and make a scroll bar at the bottom, whereas on large/wide screens the image wont be wide enough. So, my question is: how do you make it compatible with all screen resolutions(without having a scroll bar on the bottom or a gap)? To have it resize properly for everyone who uses it? Sorry if I sound dumb.
Abby is offline   Reply With Quote
Old 12th June 11, 03:18 AM   #2
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,134
Default Re: How to make images resize automatically?

First, your top line should be <i><style type="text/css"></i>

The answer to your question should be width:100% on your image tag.
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 12th June 11, 10:33 AM   #3
chrishirst
Banned
 
Join Date: Jun 2006
Location: Blackp ool U.K.
Posts: 3,197
Default Re: How to make images resize automatically?

http://unstoppablerobotninja.com/entry/fluid-images/
chrishirst is offline   Reply With Quote
Old 22nd June 11, 01:37 AM   #4
Phreaddee
WLC Lover
 
Phreaddee's Avatar
 
Join Date: Oct 2010
Location: Newcastle, NSW, Australia
Posts: 703
Default Re: How to make images resize automatically?

so can anyone explain to me then what is wrong with this solution?
Code:
#div-that-image-sits-in img {
width:100%; 
height:auto;
}
this seems to work for me on every fluid site i've made...

surely that script within that link is just a bit of overkill yeah?

Last edited by Phreaddee; 22nd June 11 at 01:51 AM.
Phreaddee is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:05 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyright© 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.