我在 Div 框中的文本开始位置低于 Div 框的顶部,我应该如何修复它?

问题描述 投票:0回答:1

我正在尝试创建一个网站,其中有一个 Div 框,当您向下滚动时,其中会显示文本,但文本会向下缩进很远。这是我的网站(忽略自动向下滚动,我正在努力),https://6228c358-bc9a-4d97-8361-5c41c877d12c-00-zyltbemburfn.riker.replit.dev/?initialPath=%2F&id= %3Ar1f%3A#white_section-1。这是我的 HTML:

  <div class="scroll_link"><a href="#white_section-1"><img  class="arrow_image" src="arrow.png" alt="arrow"> </a></div>


<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>

  <div id="white_section-1">
    <h1 class="white_sec_title-1">Information </h1>
     Starting on September the 2nd, 1939, World World War II was one of the deadliest wars in all of history. The conflict was the cause of the deaths of almost a 100 million people, both soldiers and civilians.
  </div>

  </center>
</a>

这是我关于 Div Box 的 CSS:

#white_section-1 {
  background-color: #fff;
  height: 460px;
  padding-top: 14px;
}

.scroll_link {
  background-color: rgba(0, 0, 0, 0.75);
  height: 80px;
  width: 80px;
  -webkit-border-radius: 25px;
  -moz-border-radius: 25px;
  border-radius: 25px;
  position: fixed;
  bottom: 20px;
  right: 20px;
}

.arrow_image {
  width: 85%;
  height: 90%;
  padding-top: 4px;
}

这是我所有的 javascript,没有任何重要的或与该问题相关的内容。

 function wpse_google_webfonts() {
 $protocol = is_ssl() ? 'https' : 'http';
 $query_args = array(
     'family' => 'Raleway',
     'subset' => 'latin,latin-ext',
 );

 wp_enqueue_style('google-webfonts',
     add_query_arg($query_args, "$protocol://fonts.googleapis.com/css? 
 family=Raleway" ),
     array(), null);
 }
 add_action( 'wp_enqueue_scripts', 'wpse_google_webfonts' );

我尝试更改填充:

.white_sec_title-1 {
  padding-top: 14px;
}

我也尝试删除

,但间隙仍然存在。

我还删除了

和 div 行之间的任何无关紧要的代码,但这也不起作用。

最后,我对代码进行了三重检查,看看是否有任何东西限制了 div 框顶部的

,但除了

标签本身之外没有其他任何东西,删除后不起作用。

您尝试过定义

margin:0
吗?

html css spacing
1个回答
0
投票

您尝试过定义

margin:0
吗?

© www.soinside.com 2019 - 2024. All rights reserved.