gpt4 book ai didi

html - 如何添加将所有其他数据向下推的固定横幅?

转载 作者:行者123 更新时间:2023-11-28 06:24:28 26 4
gpt4 key购买 nike

我想为当前的事件在我的网页上添加标题。到目前为止我有代码,但是当我添加它时它覆盖了我的 Logo 和另一个标题。我如何解决这个问题以便它向下推页面的其余部分?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Test</title>
<style type="text/css" media="screen">
* {
margin: 0;
padding: 0;
}

div#banner {
position: absolute;
top: 0;
left: 0;
background-color: #00AD83;
width: 100%;
}
div#banner-content {
width: 200px;
margin: 0 auto;
padding: 10px;
border: 1px solid #000;
}
div#main-content {
padding-top: 70px;
}
</style>
</head>

<body>
<div id="banner">
<div id="banner-content">
Banner content will go here
</div>
</body>
</html>

最佳答案

为后面的内容添加上边距:

#banner + * {
margin-top: 70px; /* or whatever the banner's actual height is */
}

关于html - 如何添加将所有其他数据向下推的固定横幅?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35368907/

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