Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正文和html之间的边距_Html_Frontend_Margin - Fatal编程技术网

正文和html之间的边距

正文和html之间的边距,html,frontend,margin,Html,Frontend,Margin,我检查了整页,但找不到答案。我的html标记和body标记之间有一个空白,但我不知道为什么。 谢谢你的回答。该网站位于将以下内容添加到您的css中: body { margin: 0; } 如果以上方法无效,请尝试以下方法。 (它将覆盖任何其他边距值。): 发布一些代码会有所帮助。我想提出同样的建议,要么是HTML,要么是有边距或填充的正文,但是没有 你有这个: <div class="row"> <div class="col-sm-12 c

我检查了整页,但找不到答案。我的html标记和body标记之间有一个空白,但我不知道为什么。
谢谢你的回答。该网站位于

将以下内容添加到您的css中:

body {
margin: 0;
}
如果以上方法无效,请尝试以下方法。 (它将覆盖任何其他边距值。):


发布一些代码会有所帮助。我想提出同样的建议,要么是HTML,要么是有边距或填充的正文,但是没有

你有这个:

<div class="row">
                <div class="col-sm-12 col-md-6 col-section-1-1">
                    <aside>
                        <h2 class="heading section__1__heading-big">Kõik olümpiavõitjad
                            on kusagilt alustanud!</h2>
                        <p class="paragraph section__1__paragraph-intro">Kutsume Sind toetama tulevaste võitjate arengut, et
                            saaksid olla osaline nende suurtest saavutusest. Kogutud
                            toetussummat kasutame sihipäraselt sportlaste arengu
                            toetamiseks läbi  stipendiumite ja koolituste.
                        </p>
                        <button class="button button__kristian active"><p>Kristian Ilves</p></button>
                        <button class="button button__mattias"><p>Mattias Kuusik</p></button>
                        <button id="modalBtn">
                            <img src="images/Play.svg" alt="vaata videot">

                        </button>
                        <span class="button">Vaata videot</span>
                        <a href="https://www.instagram.com/explore/tags/leiaendasv%C3%B5itja/" target="_blank">
                            <p class="paragraph section__1__paragraph-hashtag">#leiaendasvõitja</p>
                        </a>
                    </aside>
                </div>


                <div class="col-sm-12 col-md-6 displayNonePhone">
                    <p class="paragraph section__1__paragraph-secondside">TÄISVERSIOON LEHEST ON ARENDAMISEL</p>
                    <a href="http://www.nooredolumpiale.ee/toeta" target="_blank">
                        <p class="paragraph section__1__paragraph-secondsidetwo">Külasta vana lehte</p>
                    </a>
                </div>
            </div>

TÄ是阿伦达米塞尔的版本


row类的右边距为-15。删除它应该可以。

section#section_1
中有三个元素导致顶部空间太小

<h1><a href="tel:+372 9002018" class="mobileCallingNumberForcalling">9002018</a></h1>
<h1><a href="tel:+372 9002018" class="heading heading__number-desktop">9002018</a></h1>
<p><a href="#section__2" class="paragraph section__1_paragraph-reverse" id="loeLisaks">Loe lisaks </a></p>
如果您真的需要,您可以使用选择器获得更具体的信息

section#section__1 > * {
    margin: 0;
}
此代码删除了顶部和右侧的空格。
您已将孩子设置为固定,但他们的父母已经有了一些边距。

自然边距,只需将html和Body的边距设置为0谢谢您的建议,但我已经有了这些规则。第一部分中有2个
h1
和一个
p
标记导致了问题
h1
有自然边距,看起来他们的内容没有显示出来,所以你得到了额外的边距感谢这个建议,但我已经有了这个css规则,它不起作用。更新了建议。谢谢你的建议,但看起来它实际上与边距无关。请发布你的css文件这也会改变他正在使用的Bootstrap
.row
元素的边距,这不会影响页面顶部的空间。他问的是“在我的html标记和我的body标记之间”。这两个标记之间实际上没有空白,但由于
位于页面顶部,因此可以合理地假设顶部的空间是导致问题的原因。
.row
类上的边距是由Bootstrap故意设置的,尽管Bootstrap确实会导致令人恼火的CSS问题,但这个问题与原始海报所问的问题无关。他使用的是一个
.row
而不是一个
容器。根据GitHub的评论,水平滚动条是预期的行为。。。从某个角度来看的特征。固定侧面空间的方法是将
.container
包裹在行周围。我猜他们会说他使用引导错误。。。那是我的错。但我的回答是牢记双方。他没有使用任何具有15px正确填充的引导类或样式。嘿!我自己也试过了,但似乎不管用。它仍然管用。我肯定你遇到了问题。查看您的页面,我看到所有
H1
元素都有
margin-bottom:.5rem
来自引导,所有
P
元素都有
margin-bottom:1rem
,也来自引导。为了覆盖这些,您需要使用更具体的选择器。我会用推荐更新我的答案,但我没有任何方法在你的现场测试它。
#section__1 > h1,
#section__1 > p {
  margin: 0;
}
section#section__1 > * {
    margin: 0;
}