Image 100% of width

suzee_lk's picture

They have: 2 posts

Joined: Jan 2009

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

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. Wink

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.