DDR爱好者之家 Design By 杰米

本文实例为大家分享了Bootstrap导航菜单的具体代码,供大家参考,具体内容如下

效果图:

一个炫酷的Bootstrap导航菜单

点击菜单的箭头有点小问题,后面改,不是很影响。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="bootstrap/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="css/beyond.css" />
<title>beyond网站模板练习</title>
</head>
<body>
<!-- 导航 -->
<div class="page-sidebar">
 <ul class="nav panel-group sidebar-menu" id="nav_parent">
 <li class="panel">
  <a href="#">
  <i class="menu-icon glyphicon glyphicon-home"></i>
  <span class="menu-text"> Dashboard </span>
  </a>
 </li>
 <li class="panel">
  <a class="panel-heading collapsed" href="#collapse1" data-toggle="collapse" data-parent="#nav_parent">
  <i class="menu-icon glyphicon glyphicon-fire"></i>
  <span class="menu-text">Elements</span>
  <i class="glyphicon glyphicon-chevron-right menu-expand"></i>
  </a>
  <ul class="nav submenu collapse" id="collapse1">
  <li>
   <a href="#"><span class="menu-text">Basic Elements</span></a>
  </li>
  <li>
   <a class="panel-heading collapsed" href="#collapse2" data-toggle="collapse">
   <span class="menu-text">Icons</span>
   <i class="glyphicon glyphicon-chevron-right menu-expand"></i>
   </a>
   <ul class="nav submenu collapse" id="collapse2">
   <li>
    <a href="#">
    <i class="menu-icon glyphicon glyphicon-stats"></i>
    <span class="menu-text">Font Awesome</span>
    </a>
   </li>
   <li>
    <a href="#">
    <i class="menu-icon glyphicon glyphicon-stats"></i>
    <span class="menu-text">Glyph Icons</span>
    </a>
   </li>
   </ul>
  </li>
  <li>
   <a href="#">
   <span class="menu-text">Tabs &amp; Accordions</span>
   </a>
  </li>
  <li>
   <a href="#">
   <span class="menu-text">Alerts &amp; Tooltips</span>
   </a>
  </li>
  <li>
   <a href="#">
   <span class="menu-text">Modals &amp; Wells</span>
   </a>
  </li>
  </ul>
 </li>
 <li class="panel">
  <a class="panel-heading collapsed" href="#collapse5" data-toggle="collapse" data-parent="#nav_parent">
  <i class="menu-icon glyphicon glyphicon-link"></i>
  <span class="menu-text">More Pages</span>
  <i class="glyphicon glyphicon-chevron-right menu-expand"></i>
  </a>
  <ul class="nav submenu collapse" id="collapse5">
  <li>
   <a href="#"><span class="menu-text">Error 404</span></a>
  </li>
  <li>
   <a href="#"><span class="menu-text"> Grid</span></a>
  </li>
  <li>
   <a class="panel-heading collapsed" href="#collapse6" data-toggle="collapse">
   <span class="menu-text">Multi Level Menu</span>
   <i class="glyphicon glyphicon-chevron-right menu-expand"></i>
   </a>
   <ul class="nav submenu collapse" id="collapse6">
   <li>
    <a href="#">
    <i class="menu-icon glyphicon glyphicon-stats"></i>
    <span class="menu-text">Level 3</span>
    </a>
   </li>
   <li>
    <a class="panel-heading collapsed" href="#collapse7" data-toggle="collapse">
    <i class="menu-icon glyphicon glyphicon-stats"></i>
    <span class="menu-text">Level 4</span>
    <i class="glyphicon glyphicon-chevron-right menu-expand"></i>
    </a>
    <ul class="nav submenu collapse" id="collapse7">
    <li>
     <a href="#">
     <i class="menu-icon glyphicon glyphicon-stats"></i>
     <span class="menu-text">Some Item</span>
     </a>
    </li>
    <li>
     <a href="#">
     <i class="menu-icon glyphicon glyphicon-stats"></i>
     <span class="menu-text">Another Item</span>
     </a>
    </li>
    </ul>
   </li>
   </ul>
  </li>
  </ul>
 </li>
 </ul>
</div>
<script type="text/javascript" src="/UploadFiles/2021-04-02/jquery.min.js">

CSS代码:

.page-sidebar{
 position: absolute;
 top: 0;
 bottom: 0;
 width: 224px;
 display: block;
}
.page-sidebar .sidebar-menu {
 margin: 0;
 padding: 0;
 margin-left: 5px;
}
.page-sidebar:before{
 content: "";
 position: fixed;
 display: block;
 width: 219px;
 bottom: 0;
 top: 0;
 left: 5px;
 background-color: #fff;
 -webkit-box-shadow: 0 0 10px 0 rgba(0,0,0,.2);
 -moz-box-shadow: 0 0 10px 0 rgba(0,0,0,.2);
 box-shadow: 0 0 10px 0 rgba(0,0,0,.2);
 z-index: 1;
}
.page-sidebar .sidebar-menu a{
 color: #737373;
 z-index: 123;
 padding: 0 16px 0 7px;
 margin: 0;
 height: 38px;
 line-height: 36px;
 -webkit-text-shadow: none!important;
 text-shadow: none!important;
 font-size: 13px;
}
.page-sidebar .submenu{
 margin: 0;
 padding: 0;
 position: relative;
 float: none;
 background-color: #fbfbfb;
 border: 0;
 box-shadow: inset 0 4px 4px -2px rgba(0,0,0,.15),inset 0 -4px 4px -2px rgba(0,0,0,.15);
 border-radius: 0;
 z-index: 123;
}
.page-sidebar .sidebar-menu>li>a {
 border-top: 1px solid #f3f3f3;
}

/* 菜单前面的小图标*/
.page-sidebar .sidebar-menu a .menu-icon {
 display: inline-block;
 vertical-align: middle;
 min-width: 30px;
 text-align: center;
 font-size: 14px;
 font-weight: normal;
 font-style: normal;
 margin-top: -3px;
}

/* 向右的箭头*/
.page-sidebar .sidebar-menu a .menu-expand{
 display: inline-block;
 position: absolute;
 font-size: 10px;
 line-height: 10px;
 height: 10px;
 width: 10px;
 right: 12px;
 top: 15px;
 margin: 0;
 text-align: center;
 padding: 0;
 -webkit-text-shadow: none;
 text-shadow: none;
 color: #666;
 -webkit-transition: all 300ms ease-in-out;
 -moz-transition: all 300ms ease-in-out;
 -o-transition: all 300ms ease-in-out;
 transition: all 300ms ease-in-out;
 font-style: normal;
 font-weight: normal;
}
.panel-group .panel{
 margin: 0;
 margin-top:0 !important;
 border: none;
}

/* 第一层级缩进 */
.page-sidebar .sidebar-menu .submenu>li>a {
 padding-left: 40px;
}
/* 第二层级缩进 */
.page-sidebar .sidebar-menu .submenu>li .submenu>li>a {
 padding-left: 50px;
}
.page-sidebar .sidebar-menu a:hover {
 color: #262626;
}
/* 选中增加蓝色border */
.page-sidebar .sidebar-menu .active:before {
 display: block;
 content: "";
 position: absolute;
 top: 0;
 bottom: 0;
 left: -4px;
 width: 4px;
 max-width: 4px;
 overflow: hidden;
 background-color: #2dc3e8;
}
.page-sidebar .sidebar-menu li a:not(.panel-heading):hover:before {
 display: block;
 content: "";
 position: absolute;
 top: 0;
 bottom: 0;
 left: -4px;
 width: 4px;
 max-width: 4px;
 overflow: hidden;
 background-color: #fb6e52;
}

如果大家还想深入学习,可以点击这里进行学习,再为大家附3个精彩的专题:

Bootstrap学习教程

Bootstrap实战教程

Bootstrap Table使用教程

Bootstrap插件使用教程

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。

DDR爱好者之家 Design By 杰米
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
DDR爱好者之家 Design By 杰米

P70系列延期,华为新旗舰将在下月发布

3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。

而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?

根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。