简体   繁体   中英

Background image css not scaling down properly

I'm trying to put an image as a background of my project insde the body component, but when I reduce the screen width the image doesn't overflow correctly. This is what I have now:

在此处输入图像描述

the css is:

body {
  background-image: url("https://phoenix-engineering.be/wp-content/uploads/2019/07/shutterstock_1113165392.png");
  background-size: cover;
  overflow: hidden;
  background-position: unset;
  background-repeat: no-repeat;

  text-align: center;
  font-family: "Roboto", sans-serif;
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;

  min-width: 350px;
}

and when I resize the screen it results to this:

在此处输入图像描述

Is there a way to fix this issue?

use min-height:100vh

body {
  //prev_styles

  min-height:100vh; <-
}

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