Victor Wei
Victor Wei

Reputation: 359

html - Automatic zoom to different monitor sizes

I've been wondering if there was a way to change the zoom on an html webpage according to the monitor size. For example, a 500px by 500px image would look big on a laptop although a monitor for a PC would make it look small. Is there possible solution I can make so that the picture scales in size as the monitor size changes? Also, I would like the screen to just zoom not change in pixels.

Thanks!

Upvotes: 0

Views: 67

Answers (1)

Sylvain
Sylvain

Reputation: 417

You could use % instead of px to set the size of the image.

In HTML 4.01, the width could be defined in pixels or in % of the containing element. In HTML5, the value must be in pixels.

source: https://www.w3schools.com/tags/att_img_width.asp

Or in CSS you could use Media Queries to have different style depending on the device used.

Upvotes: 1

Related Questions