简体   繁体   English

HTML 中的空白是什么?

[英]What is this white space in the HTML?

I'm creating an application, more specifically the mobile version, and when I start to enter styles I see this blank space that I can't find where it comes from.我正在创建一个应用程序,更具体地说是移动版本,当我开始输入 styles 时,我看到这个空白区域,我找不到它的来源。 Can anyone help me?谁能帮我?

在此处输入图像描述

The app is being made with NextJS, the global styles I have are:该应用程序是用 NextJS 制作的,我拥有的全局 styles 是:

* {
  border: none;
    margin: 0;
    padding: 0;
  box-sizing: border-box;
}

html, body {
  display: block;
}

main {
  padding: 0;
  margin: 0;
  font-family: $primary_font;
  display: flex;
  flex-direction: column;
  align-items: center;
}

Setting a html style overflow-x: hidden is a band-aid way to remove that space.设置 html 样式overflow-x: hidden是删除该空间的创可贴方法。

To find the element that is causing the overflow, expand the DOM trees and hover over the elements until you find the one(s) that are sticking out.要找到导致溢出的元素,请在元素上展开 DOM 树和 hover,直到找到突出的元素。 I'd start by looking at the "Asmae..." text, the header, and the footer if there is one.我将从查看“Asmae...”文本、header 和页脚(如果有)开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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