还是分享一下自己写过的东西吧:
代码段:
HTML:
- 入门
- 全局css样式
- 组件
- JavaScript插件
- 定制
- 网站实例
Bootstrap中文文档
- v3
- 优站精选
- 官方博客
- 返回Bootstrap中文网
css:
body {
height: 2000px;
}
.nav-wrapper {
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 999;
}
.nav {
padding: 0 15px;
color: #523e78;
height: 50px;
line-height: 50px;
}
.nav>.title {
margin: 0 auto;
}
.title>h2 {
float: left;
}
.title>.titleIcon {
float: right;
}
.title>.titleIcon>i {
color: #523e78;
font-size: 14px;
height: 34px;
line-height: 20px;
padding: 9px 10px;
border-radius: 5px;
}
.title>.titleIcon>i:hover {
background-color: #ccc;
}
.title>.titleIcon>i:active {
background-color: #ccc;
}
.clearfix::after {
content: '';
display: table;
clear: both;
}
.nav-list {
margin: 0 -15px;
display: none;
}
.nav-list li:hover {
background-color: #f9f9fa;
}
.nav-list a {
color: #523e78;
padding: 10px 15px;
}
.background-pic {
padding-top: 50px;
}
img {
width: 100%;
}
@media all and (min-width:768px) {
.nav{
width: 720px;
margin: 0 auto;
padding: 0 40px;
}
.title{
display: none;
}
.nav-list{
display: block;
}
.nav-listH2{
display: block;
}
.nav-list-right{
display: none;
}
.nav-list li,.nav-list h2{
float: left;
}
.navList >ul>li{
font-size: 14px;
font-weight: bold;
}
}
@media all and (min-width:968px) {
.nav{
width: 100%;
max-width: 1140px;
margin: 0 auto;
}
.nav-list-right{
display: block;
float: right;
}
.navList >ol>li{
font-size: 14px;
font-weight: bold;
}
}
效果图:



