简体   繁体   中英

How do I make an image relative to the screen size in css?

I have an image background in css and 2 images overlaying that. On my device I can line them up perfectly the way I want, but when I go to view them on another device or change my screen size, the 2 overlaying images change size and position while the background doesn't. I know there's a line of css that I'm missing or doing wrong, so if anyone could help it would be much appreciated. Thanks, and here's my code:

在此处输入图片说明

实际上没关系,我刚刚发现通过使用百分比而不是像素来自动调整位置和宽度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM