a标签做成按钮:
<a href="" class="btn btn-primary btn-sm navbar-btn">订阅课程</a>
btn
是基础,btn-primary
和 btn-sm
是决定样式的具体类。
使用了navbar-btn
就对齐了。
文字:navbar-text
按钮:navbar-btn
代码:
<!doctypoe html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<a href="#" class="navbar-brand">www.<strong>google</strong>.com</a>
<ul class="nav navbar-nav">
<li class="active"><a href="">课程</a></li>
<li><a href="">博客</a></li>
<li><a href="">手册</a></li>
</ul>
<a href="" class="btn btn-primary btn-sm navbar-btn navbar-right">订阅课程</a>
<div class="profile navbar-right">
<ul class="nav navbar-nav ">
<li><a href="">登录</a></li>
<li><a href="">注册</a></li>
</ul>
<p class="navbar-text">
Hello, <a href="#" class="navbar-link">Deng</a>
</p>
</div>
</div>
</nav>
<div class="container" style="height:5000px;">
<div>
<h1>title123</h1>
<p>按时打算是多少对阿斯达方的方式斯蒂芬斯蒂芬按时打算</p>
</div>
</div>
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
</body>
</html>
style.css:
body {
padding-top: 52px;
}
.navbar-inverse input[type="text"] {
background-color: #313131;
border: none;
color: #999;
}
.navbar-inverse .navbar-form {
position: relative;
}
.navbar-inverse .navbar-form input{
width: 75%;
}
.profile {
margin-right: 25px;
}
效果:
图片.png
网友评论