为什么我的HTML /正文尺寸不适合较小屏幕(移动尺寸)的屏幕尺寸

时间:2020-07-19 12:36:52

标签: html css media-queries

每当我的屏幕尺寸减小到约350像素以下时,html和主体尺寸就会变成屏幕尺寸的一半甚至更低。 我尝试将HTML和BODY标签宽度设置为100%,100vw和自动。仍然没有运气。 我使用媒体查询的最大宽度:800像素的响应度。图:HTML size for smaller screen

身体风格:

body {
  padding: 4rem;
  padding-top: 1rem;
  background-color: black;
  background-image: url("test1.jpg");
  background-position: center; /* Center the image */
  background-size: cover; /* Resize the background image to cover the entire container */
}

@media screen and (max-width: 800px){
  body {
    padding: 10px;
  }
}

0 个答案:

没有答案