bootstrap常用组件之头部导航实现代码

 更新时间:2017年04月20日 08:45:31   作者:web_zhuo  
这篇文章主要介绍了bootstrap常用组件之头部导航实现代码,然后对个别常用属性进行了解释,需要的的朋友参考下吧

以下是头部导航的代码,我只简要的对个别常用属性进行解释

总效果如图所示:

代码如下:

<nav class="navbar navbar-default navbar-inverse navbar-fixed-top"> 
//navbar-inverse 设置背景                                                        
//navbar-fixed-top 设置头部固定在顶部,因此需要给body设置顶部padding,一般设置为padding-top:60px
 <div class="Container-fluid"> 
//container-fluid设置导航条内容是否有一定的内间距,如果class="container-fluid"则没有内间距,内容紧贴左侧        
//如果设置class="container",则内容有一定的内间距,内容对称居中
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class="navbar-header">
   <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
   </button>   //这里是响应式的写法,在小屏幕上回显示三杆,无需改动
   <a class="navbar-brand" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >某管理系统</a>
  </div>
  <!-- Collect the nav links, forms, and other content for toggling -->
  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
   <ul class="nav navbar-nav">
    <li class="active"><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >首页 <span class="sr-only">(current)</span></a></li>
    <li class="dropdown">
     <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">功能 <span class="caret"></span></a>
     <ul class="dropdown-menu">
      <li class="dropdown-header" >业务功能</li>
      <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >信息建立</a></li>
      <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >信息查询</a></li>
      <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >信息管理</a></li>
      <li role="separator" class="divider"></li>
      <li class="dropdown-header" >系统功能</li>
      <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >设置</a></li>
      <li role="separator" class="divider"></li>
     </ul>
    </li>
    <li><a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >帮助</a></li>
   </ul>
   <form class="navbar-form navbar-left pull-right">
    <div class="form-group">
     <input type="text" class="form-control" placeholder="username...">
     <input type="password" class="form-control" placeholder="password...">
    </div>
    <button type="submit" class="btn btn-default">Login</button>
   </form>
  </div><!-- /.navbar-collapse -->
 </div><!-- /.container-fluid -->
</nav>

您可能感兴趣的文章:

相关文章

  • JS异步宏队列微队列原理详解

    JS异步宏队列微队列原理详解

    这篇文章主要介绍了JS异步宏队列微队列原理详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2020-09-09
  • 借助云开发实现小程序短信验证码的发送

    借助云开发实现小程序短信验证码的发送

    这篇文章主要介绍了借助云开发实现小程序短信验证码的发送,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-01-01
  • JS+CSS3制作炫酷的弹窗效果

    JS+CSS3制作炫酷的弹窗效果

    本文给大家分享使用js和css3制作的炫酷弹窗效果,整个背景模糊,要比纯色加透明度高大上好多。对js弹窗效果感兴趣的朋友一起学习吧
    2016-11-11
  • 微信小程序开发中所碰到问题集锦

    微信小程序开发中所碰到问题集锦

    这篇文章主要介绍了微信小程序开发中所碰到问题集锦,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习吧
    2023-01-01
  • JS实现DOM删除节点操作示例

    JS实现DOM删除节点操作示例

    这篇文章主要介绍了JS实现DOM删除节点操作,结合实例形式分析了javascript使用removeChild()操作页面dom节点删除功能的相关实现技巧,需要的朋友可以参考下
    2018-04-04
  • js实现鼠标滚轮控制图片缩放效果的方法

    js实现鼠标滚轮控制图片缩放效果的方法

    这篇文章主要介绍了js实现鼠标滚轮控制图片缩放效果的方法,涉及onmousewheel事件及javascript操作图片的技巧,具有一定参考借鉴价值,需要的朋友可以参考下
    2015-02-02
  • Bootstrap 响应式实用工具实例详解

    Bootstrap 响应式实用工具实例详解

    Bootstrap 提供了一些辅助类,以便更快地实现对移动设备友好的开发。这些可以通过媒体查询结合大型、小型和中型设备,实现内容对设备的显示和隐藏。下面通过本文给大家分享Bootstrap 响应式实用工具,一起看看吧
    2017-03-03
  • JS设计模式之访问者模式的用法详解

    JS设计模式之访问者模式的用法详解

    JS访问者模式是一种行为型设计模式,用于将算法与对象结构分离, 该模式允许你定义新的操作(访问者)而无需修改现有对象结构(被访问者), 通过这种方式,你可以在不改变对象结构的情况下添加新的操作,本文就给大家详细的讲讲JS访问者模式的用法
    2023-08-08
  • BootStrap点击下拉菜单项后显示一个新的输入框实现代码

    BootStrap点击下拉菜单项后显示一个新的输入框实现代码

    这篇文章主要介绍了BootStrap点击下拉菜单项后显示一个新的输入框实现代码的相关资料,需要的朋友可以参考下
    2016-05-05
  • 前端把html表格生成为excel表格的实例

    前端把html表格生成为excel表格的实例

    下面小编就为大家带来一篇前端把html表格生成为excel表格的实例。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
    2017-09-09

最新评论