我无法点击链接,因为页眉占据了我的整个页面。

huangapple go评论56阅读模式
英文:

I can't click on the links because the header takes up all of my site

问题

<div>内部的链接不可点击,而且出现了整个网站都被<header>覆盖的情况,我无法解决。<nav>内部的链接工作正常,但在链接内部的<header>无法工作。
如何解决这个问题?

以下是你的HTML和CSS代码的翻译:

<html>
<body>
  <header>
    <div class="background">
      <div class="homepage">
        <div class="block">
          <img class="lock" src="images/img.png">
          <p class="title">thehamam 是什么?</p>
          <a id="rules" href="https://thehamam.com/rules" target="_blank"><span>我们的规则</span></a>
          <p>如果要用三个词来总结,那将是"自由社交网络"。如果要详细解释,那就是在今天的平台中没有限制,任何人都可以匿名留存的唯一社交网络。请记住,thehamam会像亲生孩子一样保护你的数据!</p>
        </div>
        <div class="block">
          <img class="lock" src="/images/pepe.png">
          <p class="title">这个社交网络上可以做什么?</p>
          <p>您可以选择一个主题并发布帖子,上传文件,选择适合您心情的表情符号并回复帖子。我们的规则不会限制你,你可以自由表达你的想法。</p>
        </div>
        <p id="end">这个页面的底部了!</p>
      </div>
    </div>
  </header>
</body>
</html>
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  text-decoration: none;
  font-family: 'Skyline Beach NBP', sans-serif;
  list-style: none;
}

.material-symbols-sharp {
  font-variation-settings: 'FILL' 1, 'wght' 700, 'GRAD' 200, 'opsz' 48;
}

html,
body {
  margin: 0;
  padding: 0;
  min-width: 100%;
  z-index: 0;
}

.material-symbols-sharp {
  color: #dadada;
  z-index: 2;
}

.background {
  position: relative;
  display: flex;
  justify-content: space-evenly;
  padding: 120px;
  padding-top: 10px;
  top: 0;
  width: 100%;
  height: 1920px;
  background-color: #121212;
  z-index: -1;
}

.homepage {
  position: relative;
  background-color: transparent;
  border: 1px solid #1a1a1a;
  margin-top: 90px;
  width: 1105px;
  height: 1720px;
  border-radius: 10px;
  z-index: 999;
  padding: 10px;
}

.block {
  text-align: center;
  width: 50%;
  padding: 10px;
  float: left;
  display: block;
}

.lock {
  width: 100px;
  height: 100px;
  margin: 0;
  outline: 1px solid #252525;
}

.rules {
  position: relative;
  z-index: 999;
}

em {
  font-size: 20px;
  letter-spacing: 1px;
  font-style: normal;
  text-decoration: 1.5px underline #dadada;
}

p {
  font-family: 'Skyline Beach NBP', sans-serif;
  color: #dadada;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.title {
  margin: 0;
  margin-bottom: 10px;
  color: #dadada;
  font-size: 24px;
  position: relative;
}

a,
a:link,
a:visited {
  font-family: 'Skyline Beach NBP', sans-serif;
  font-size: 20px;
  color: #dadada;
  text-decoration: 1.5px underline #3c3c3c;
  z-index: 22;
}

input[type="text"]:focus {
  border: none !important;
  outline: none !important;
}

这是你代码的翻译部分。希望对你有所帮助。

英文:

Links inside &lt;div&gt; are not clickable. and for some reason the whole site is covered with &lt;header&gt;, I couldn't figure it out. Links (&lt;a&gt;) inside &lt;nav&gt; working but &lt;header&gt; inside links not working.
how can I solve this problem?

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-css -->

* {
padding: 0;
margin: 0;
box-sizing: border-box;
text-decoration: none;
font-family: &#39;Skyline Beach NBP&#39;, sans-serif;
list-style: none;
}
.material-symbols-sharp {
font-variation-settings: &#39;FILL&#39; 1, &#39;wght&#39; 700, &#39;GRAD&#39; 200, &#39;opsz&#39; 48
}
html,
body {
margin: 0;
padding: 0;
min-width: 100%;
z-index: 0;
}
.material-symbols-sharp {
color: #dadada;
z-index: 2;
}
.arkaplan {
position: relative;
display: flex;
justify-content: space-evenly;
padding: 120px;
padding-top: 10px;
top: 0;
width: 100%;
height: 1920px;
background-color: #121212;
z-index: -1;
}
.anasayfa {
position: relative;
background-color: transparent;
border: 1px solid #1a1a1a;
margin-top: 90px;
width: 1105px;
height: 1720px;
border-radius: 10px;
z-index: 999;
padding: 10px;
}
.blok {
text-align: center;
width: 50%;
padding: 10px;
float: left;
display: block;
}
.lock {
width: 100px;
height: 100px;
margin: 0;
outline: 1px solid #252525;
}
.kurallar {
position: relative;
z-index: 999;
}
em {
font-size: 20px;
letter-spacing: 1px;
font-style: normal;
/* Removes italics */
text-decoration: 1.5px underline #dadada;
/* Makes underline */
}
p {
font-family: &#39;Skyline Beach NBP&#39;, sans-serif;
color: #dadada;
font-size: 20px;
letter-spacing: 0.2px;
}
.baslik {
margin: 0;
margin-bottom: 10px;
color: #dadada;
font-size: 24px;
position: relative;
}
a,
a:link,
a:visited {
font-family: &#39;Skyline Beach NBP&#39;, sans-serif;
font-size: 20px;
color: #dadada;
text-decoration: 1.5px underline #3c3c3c;
z-index: 22;
}
input[type=&quot;text&quot;]:focus {
border: none!important;
outline: none!important;
}

<!-- language: lang-html -->

&lt;html&gt;
&lt;body&gt;
&lt;header&gt;
&lt;div class=&quot;arkaplan&quot;&gt;
&lt;div class=&quot;anasayfa&quot;&gt;
&lt;div class=&quot;blok&quot;&gt;
&lt;img class=&quot;lock&quot; src=&quot;goruntuler/img.png&quot;&gt;
&lt;p class=&quot;baslik&quot;&gt;thehamam nedir?&lt;/p&gt;
&lt;a id=&quot;kurallar&quot; href=&quot;https://thehamam.com/kurallar&quot; target=&quot;_blank&quot;&gt;&lt;span&gt;kurallarımız&lt;/span&gt;&lt;/a&gt;
&lt;p&gt;eğer 3 kelime ile &#246;zetleyecek olursak &quot;&#246;zg&#252;r sosyal ağ&quot; olacaktır. geniş&#231;e tanımlarsak g&#252;n&#252;m&#252;z platformlarındaki kısıtlamaların bulunmadığı isteyen kişilerin anonim kalabileceği yegane ağ. unutmayın, thehamam verilenizi canı gibi korur!&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blok&quot;&gt;
&lt;img class=&quot;lock&quot; href=&quot;/&quot; src=&quot;goruntuler/pepe.png&quot;&gt;
&lt;p class=&quot;baslik&quot;&gt;peki bu ağda ne yapılıyor?&lt;/p&gt;
&lt;p&gt;onlarca konudan birini se&#231;ip g&#246;nderi oluşturabilir, dosya y&#252;kleyebilir, ruh halinizi yansıtacak wojağınızı se&#231;ebilir ve g&#246;nderilere cevap verebilirsiniz. kurallarımız baskıcı değildir. fikirlerinizi &#246;zg&#252;rce ifade edebilirsiniz.&lt;/p&gt;
&lt;/div&gt;
&lt;p sid=&quot;son&quot; bu sayfanın sonu olsa gerek!&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/header&gt;
&lt;/body&gt;
&lt;/html&gt;

<!-- end snippet -->

我无法点击链接,因为页眉占据了我的整个页面。

答案1

得分: 1

尝试将 .arkaplanz-index 设置为 1000:

.arkaplan {
  position: relative;
  display: flex;
  justify-content: space-evenly;
  padding: 120px;
  padding-top: 10px;
  top: 0;
  width: 100%;
  height: 1920px;
  background-color: #121212;
  z-index: 1000;
}
英文:

Try setting z-index for .arkaplan to 1000:

<!-- begin snippet: js hide: false console: true babel: null -->

<!-- language: lang-css -->

* {
padding: 0;
margin: 0;
box-sizing: border-box;
text-decoration: none;
font-family: &#39;Skyline Beach NBP&#39;, sans-serif;
list-style: none;
}
.material-symbols-sharp {
font-variation-settings: &#39;FILL&#39; 1, &#39;wght&#39; 700, &#39;GRAD&#39; 200, &#39;opsz&#39; 48
}
html,
body {
margin: 0;
padding: 0;
min-width: 100%;
z-index: 0;
}
.material-symbols-sharp {
color: #dadada;
z-index: 2;
}
.arkaplan {
position: relative;
display: flex;
justify-content: space-evenly;
padding: 120px;
padding-top: 10px;
top: 0;
width: 100%;
height: 1920px;
background-color: #121212;
z-index: 1000;
}
.anasayfa {
position: relative;
background-color: transparent;
border: 1px solid #1a1a1a;
margin-top: 90px;
width: 1105px;
height: 1720px;
border-radius: 10px;
z-index: 999;
padding: 10px;
}
.blok {
text-align: center;
width: 50%;
padding: 10px;
float: left;
display: block;
}
.lock {
width: 100px;
height: 100px;
margin: 0;
outline: 1px solid #252525;
}
.kurallar {
position: relative;
z-index: 999;
}
em {
font-size: 20px;
letter-spacing: 1px;
font-style: normal;
/* Removes italics */
text-decoration: 1.5px underline #dadada;
/* Makes underline */
}
p {
font-family: &#39;Skyline Beach NBP&#39;, sans-serif;
color: #dadada;
font-size: 20px;
letter-spacing: 0.2px;
}
.baslik {
margin: 0;
margin-bottom: 10px;
color: #dadada;
font-size: 24px;
position: relative;
}
a,
a:link,
a:visited {
font-family: &#39;Skyline Beach NBP&#39;, sans-serif;
font-size: 20px;
color: #dadada;
text-decoration: 1.5px underline #3c3c3c;
z-index: 22;
}
input[type=&quot;text&quot;]:focus {
border: none!important;
outline: none!important;
}

<!-- language: lang-html -->

&lt;html&gt;
&lt;body&gt;
&lt;header&gt;
&lt;div class=&quot;arkaplan&quot;&gt;
&lt;div class=&quot;anasayfa&quot;&gt;
&lt;div class=&quot;blok&quot;&gt;
&lt;img class=&quot;lock&quot; src=&quot;goruntuler/img.png&quot;&gt;
&lt;p class=&quot;baslik&quot;&gt;thehamam nedir?&lt;/p&gt;
&lt;a id=&quot;kurallar&quot; href=&quot;https://thehamam.com/kurallar&quot; target=&quot;_blank&quot;&gt;&lt;span&gt;kurallarımız&lt;/span&gt;&lt;/a&gt;
&lt;p&gt;eğer 3 kelime ile &#246;zetleyecek olursak &quot;&#246;zg&#252;r sosyal ağ&quot; olacaktır. geniş&#231;e tanımlarsak g&#252;n&#252;m&#252;z platformlarındaki kısıtlamaların bulunmadığı isteyen kişilerin anonim kalabileceği yegane ağ. unutmayın, thehamam verilenizi canı gibi korur!&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;blok&quot;&gt;
&lt;img class=&quot;lock&quot; href=&quot;/&quot; src=&quot;goruntuler/pepe.png&quot;&gt;
&lt;p class=&quot;baslik&quot;&gt;peki bu ağda ne yapılıyor?&lt;/p&gt;
&lt;p&gt;onlarca konudan birini se&#231;ip g&#246;nderi oluşturabilir, dosya y&#252;kleyebilir, ruh halinizi yansıtacak wojağınızı se&#231;ebilir ve g&#246;nderilere cevap verebilirsiniz. kurallarımız baskıcı değildir. fikirlerinizi &#246;zg&#252;rce ifade edebilirsiniz.&lt;/p&gt;
&lt;/div&gt;
&lt;p sid=&quot;son&quot; bu sayfanın sonu olsa gerek!&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/header&gt;
&lt;/body&gt;
&lt;/html&gt;

<!-- end snippet -->

huangapple
  • 本文由 发表于 2023年2月19日 22:34:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75500858.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定