Image 100% of width
How do I get an image to be 100% of the screen width, without creating a sideways scroll bar in lower screen resolution displays?
Cheers
How do I get an image to be 100% of the screen width, without creating a sideways scroll bar in lower screen resolution displays?
Cheers
kazimmerman posted this at 13:22 — 29th January 2009.
He has: 698 posts
Joined: Jul 2005
You can simply use a percentage as the width:
...
<img src="..." width="100%" />
...
Or, hopefully you're using CSS:
img {
width: 100%;
}
The only problem you may see is with Internet Explorer (at least older versions) in that for whatever reason 100% of the screen is really around 98% instead of the full 100 and you may end up with a bit running over horizontally.
Kurtis
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.