How to use screen.width to set the width of an image?

  • 1
  • Question
  • Updated 8 years ago
  • Answered
How can I set the width of an image based on the screen width of the viewer? I think there's screen.width parameter in javascript but not quite sure how to write the code. Could someone please provide an example? Thank you!
Photo of Ebruce


  • 29 Posts
  • 1 Reply Like
  • unsure

Posted 8 years ago

  • 1
Photo of Justine


  • 751 Posts
  • 45 Reply Likes
Hi Ebruce,

I can suggest taking a look at some articles such as this: and this

Alternatively, you can post your code request in this thread:

Hope that helps!