gpt4 book ai didi

html - 修复页面顶部的菜单栏

转载 作者:太空宇宙 更新时间:2023-11-04 10:43:58 25 4
gpt4 key购买 nike

我尝试修复页面顶部的菜单栏,但没有搜索框和社交图标,但没有成功。我在我的最高嵌套元素中使用了 navbar-fixed-top,但它似乎不起作用。

这是我的 BOOTPLY... BOOTPLY

/* CSS used here will be applied after bootstrap.css */

.navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > .active > a:hover {
color: #fff;
}

.menu-container {
background-color:red;
min-height:20px;
position:relative
}

.navbar-nav a:hover {
color:#000
}

.navbar-nav a:link {
font-size:12px;
font-family:'century schoolbook';
color:#000;
text-decoration:overline
}

.brand-name a {
text-decoration:none
}

.brand-name img {
max-width:137px;
padding:2px;
/*position:absolute;*/
left:0px;
}

ul {
list-style-type:none;
}

.navbar-form input,.form-inline input {
width:auto
}

#nav.affix {
position:fixed;
top:0;
width:100%;
z-index:10
}

#sidebar.affix-top {
position:static
}

#sidebar.affix {
position:fixed;
top:80px
}

.navbar-default .navbar-nav > li > a {
color:#000;
font-family:'LuzSans-Book';
font-size:14px;
}

.navbar-default .navbar-nav > li > a:hover {
background-color:#A10000;
color:#000
}

.navbar-default .navbar-nav > .active > a {
background-color:#000;
}

.navbar-custom-social {
height:15px;
float:right;
clear:none;
margin-right:25px
}

.navbar-fixed-top {
padding-top:0
}

.search p {
background-color:blue;
border:4px dotted black;
width:20%
}

.social p {
background-color:orange;
border:4px dotted green;
width:20%
}
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<header id="nav navbar-fixed-top">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="navbar navbar-default navbar-static">

<div class="clearfix menu-container">
<div class="pull-right clearfix toggle_btn_wrap">
<a class="navbar-toggle" data-target=".navbar-collapse" data-toggle="collapse" href="#"><i class="fa fa-bars"></i></a>
</div>
<div class="pull-left brand-name">
<a href="#"><img alt="BRANDNAME" src=""></a>
</div>
<div class="clearfix prevent-float"></div>
<div class="item">item-1</div>
<div class="item">item-2</div>
<div class="item">item-3</div>

</div>
</div>
<div class="clearfix search_and_social">
<div class="search">
<p>SEARCH BOX</p>
</div>
<div class="social">
<p>SOCIAL-ICONS</p>
</div>
</div>
</div>
</div>
</div>
</header>
<div class="content">CONTENT</div>
<div class="content">CONTENT2</div>
<div class="content">CONTENT3</div>
<div class="content">CONTENT4</div>
<div class="content">CONTENT5</div>
<div class="content">CONTENT6</div>
<div class="content">CONTENT</div>
<div class="content">CONTENT2</div>
<div class="content">CONTENT3</div>
<div class="content">CONTENT4</div>
<div class="content">CONTENT5</div>
<div class="content">CONTENT6</div>
<div class="content">CONTENT</div>
<div class="content">CONTENT2</div>
<div class="content">CONTENT3</div>
<div class="content">CONTENT4</div>
<div class="content">CONTENT5</div>
<div class="content">CONTENT6</div>

最佳答案

请试试这个,

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<header id="nav navbar-fixed-top">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="navbar navbar-default navbar-fixed-top">

<div class="clearfix menu-container">
<div class="pull-right clearfix toggle_btn_wrap">
<a class="navbar-toggle" data-target=".navbar-collapse" data-toggle="collapse" href="#"><i class="fa fa-bars"></i></a>
</div>
<div class="pull-left brand-name">
<a href="#"><img alt="BRANDNAME" src=""></a>
</div>
<div class="clearfix prevent-float"></div>
<div class="item">item-1</div>
<div class="item">item-2</div>
<div class="item">item-3</div>

</div>
</div>
<div class="clearfix search_and_social">
<div class="search">
<p>SEARCH BOX</p>
</div>
<div class="social">
<p>SOCIAL-ICONS</p>
</div>
</div>
</div>
</div>
</div>
</header>
<div class="content">CONTENT</div>
<div class="content">CONTENT2</div>
<div class="content">CONTENT3</div>
<div class="content">CONTENT4</div>
<div class="content">CONTENT5</div>
<div class="content">CONTENT6</div>
<div class="content">CONTENT</div>
<div class="content">CONTENT2</div>
<div class="content">CONTENT3</div>
<div class="content">CONTENT4</div>
<div class="content">CONTENT5</div>
<div class="content">CONTENT6</div>
<div class="content">CONTENT</div>
<div class="content">CONTENT2</div>
<div class="content">CONTENT3</div>
<div class="content">CONTENT4</div>
<div class="content">CONTENT5</div>
<div class="content">CONTENT6</div>

关于html - 修复页面顶部的菜单栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35589381/

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