gpt4 book ai didi

javascript - 在我的网站上,我的一些内容被标题覆盖了。无论如何我可以解决这个问题吗

转载 作者:行者123 更新时间:2023-12-02 20:52:34 24 4
gpt4 key购买 nike

header 覆盖了我的网站,并且覆盖了一半的开头欢迎语,我可以使用或更改哪些 css 属性来解决此问题?

我正在试验我的东西,现在看起来很奇怪。您可以在 http://algninja.000webhostapp.com/ 看到它

body {
background: purple;
}
div.a {
margin:25px 10px 25px 10px;
text-align: center;
background: gold;
color: purple;
border-radius: 10px;
padding: 5px 25px;
}
#header {
position:fixed;
left:0;
top:0;
width:100%;
background-color:#13AFF2;
z-index:2;
}
button.projectsbutton {
color: purple;
border:none;
background: gold;
padding:15px 32px;
font-size: 20px;
}
<!doctype html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<div id = "header">
<button onclick = "window.location.href = 'https://google.com';"class = "projectsbutton"><b>projects</b></button>
</div>
<div class = "a">
<h1>Welcome to my website</h1>
<h3>Look around, and see what u can find</h3>
</div>
</body>
</html>

最佳答案

您可以将以下内容添加到div.a

position: relative;
top: 100px; /* or whatever value you like */

或者,如果您将边距线更改为

,则可以从 div.a 增加到 顶部边距值
margin: 25px 10px 25px 10px;

margin: 100px 10px 25px 10px;

关于javascript - 在我的网站上,我的一些内容被标题覆盖了。无论如何我可以解决这个问题吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61571325/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com