【问题标题】:Banner and top of page has blank space in between横幅和页面顶部之间有空白区域
【发布时间】:2020-02-19 00:33:20
【问题描述】:

在透明横幅和页面顶部之间有这个空间。所有边距和填充选项都设置为 0。我不知道我做错了什么,有什么想法吗?

图片:https://imgur.com/a/XQMsOVT

主体:

<video autoplay muted loop id="myVideo">
  <source src="sparkle.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>



        <div class="hero-image" >
            <h1 align="center" style="color:white; font-size:50px; font-family:Sofia;">Sparkle</h1>
        </div>

        <div id="ok">
            <H1 style="padding:0; margin:0; overflow:hidden;" align="center"> </h1>
        </div >
    <p style="position:relative;"> okok <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>  <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> okoks </p>

css:

body, html {
  margin: 0px 0px 0px 0px ;
  padding:0px 0px 0px 0px ;
  font-family: Arial, Helvetica, sans-serif;


  background-repeat:no-repeat;
  background-size:cover;
}

#myVideo {
  position: absolute;
  right: 0;
  bottom: 0;
  min-width: 100%;
  min-height: 100%;
  z-index:-10
}



.hero-image {
  overflow:scroll
  margin:0;
  top:0;
  width: 100vw;
  position: sticky;
  background-color: rgba(0, 0, 0, 0.3);
}

【问题讨论】:

标签: html css margin styling


【解决方案1】:

"overflow:scroll" 后面缺少一个逗号,这会影响 CSS 的下一行

.hero-image {
  overflow:scroll; // semi-colon added
  margin:0;
  top:0;
  width: 100vw;
  position: sticky;
  background-color: rgba(0, 0, 0, 0.3);
}

【讨论】:

    猜你喜欢
    • 2017-09-27
    • 1970-01-01
    • 2022-01-24
    • 2015-11-09
    • 1970-01-01
    • 1970-01-01
    • 2023-02-22
    • 1970-01-01
    • 2014-10-16
    相关资源
    最近更新 更多