I'm trying to make a page design like this: Click
Actually, I succeeded. The problem is that when I change the resolution of the web page, the elements overlap, the background div and PNG behave differently and everything looks terrible. (I've tried using position:absolute(PNG) and position:relative(background))
P粉0113609032024-02-22 13:30:03
You can use the background-size and background-position CSS properties. You should try this way:
body { background-image: url("your-bg-image.jpg"); background-size: cover; background-position: center; } .responsive-image { background-image: url("your-image.png"); background-size: contain; background-position: center; width: 100%; height: 100%; }