Responsive PNG image on background image?
P粉107991030
P粉107991030 2024-02-21 21:06:46
0
1
442

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粉107991030
P粉107991030

reply all(1)
P粉011360903

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%;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template