本页左侧使用的侧边栏提供了您的侧边栏外观的示例。侧边栏的构建
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="index3.html" class="brand-link">
<img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3"
style="opacity: .8">
<span class="brand-text font-weight-light">AdminLTE 3</span>
</a>
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
<img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
</div>
<div class="info">
<a href="#" class="d-block">Alexander Pierce</a>
</div>
</div>
<!-- Sidebar Menu -->
<nav class="mt-2">
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu">
<!-- Add icons to the links using the .nav-icon class
with font-awesome or any other icon font library -->
<li class="nav-item menu-open">
<a href="#" class="nav-link active">
<i class="nav-icon fas fa-tachometer-alt"></i>
<p>
Starter Pages
<i class="right fas fa-angle-left"></i>
</p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="#" class="nav-link active">
<i class="far fa-circle nav-icon"></i>
<p>Active Page</p>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Inactive Page</p>
</a>
</li>
</ul>
</li>
<li class="nav-item">
<a href="#" class="nav-link">
<i class="nav-icon fas fa-th"></i>
<p>
Simple Link
<span class="right badge badge-danger">New</span>
</p>
</a>
</li>
</ul>
</nav>
<!-- /.sidebar-menu -->
</div>
<!-- /.sidebar -->
</aside>
您可以使用两个徽标图像来代替文本徽标,您只需将标记更改为以下内容
<a href="#" class="brand-link logo-switch">
<img src="dist/img/logo-xs.png" alt="AdminLTE Docs Logo Small" class="brand-image-xl logo-xs">
<img src="dist/img/logo-xl.png" alt="AdminLTE Docs Logo Large" class="brand-image-xs logo-xl" style="left: 12px">
</a>
v3.0 文档的示例。
根据上述示例,您可以在 .logo-xs
上的 .brand-image-xl
替换为 .brand-image-xs
,反之亦然,在 .logo-xl
上替换为 .brand-image-xs
以更改徽标大小。
您可以将推送菜单按钮放在品牌中,只需用以下代码替换品牌链接代码
<div class="brand-link d-flex justify-content-between align-items-center">
<a class="brand-link" href="index3.html">
<img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3">
<span class="brand-text font-weight-light">AdminLTE 3</span>
</a>
<a class="pushmenu" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
</div>
您可以在用户面板或导航侧边栏上方添加此代码
<form class="form-inline">
<div class="input-group">
<input class="form-control form-control-sidebar" type="search" placeholder="Search" aria-label="Search">
<div class="input-group-append">
<button class="btn btn-sidebar" type="submit">
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form>
您可以在侧边栏中添加一个自定义区域,以便在菜单条目下方显示额外的按钮或文本。
您只需在 div.sidebar
之后添加此代码
<div class="sidebar-custom">
<a href="#" class="btn btn-link"><i class="fas fa-cogs"></i></a>
<a href="#" class="btn btn-secondary hide-on-collapse pos-right">Help</a>
</div>
警告!
侧边栏自定义区域仅适用于启用了
.layout-fixed
。
.sidebar-no-expand
禁用悬停/焦点上的自动展开.nav-child-indent
子级缩进.nav-compact
紧凑的导航项.nav-flat
扁平导航样式.nav-legacy
传统的 v2 导航样式.nav-collapse-hide-child
在侧边栏折叠时隐藏导航项子菜单提示!
您还可以对
.nav-sidebar
或.brand-link
使用.text-sm
以获得更小的字体。
有关侧边栏的 JS 部分的更多信息,请访问 PushMenu 插件页面