如何使侧边栏菜单与移动一起工作?

时间:2018-07-25 07:08:09

标签: menu sidebar

当有人用电话打开页面时,我希望菜单看起来像这样:

enter image description here

#side-menu {
	background-color: #581845;
	padding: 0px;
}

#side-menu h1 {
	color: #fff;
	text-align: center;
	margin-left: 10px 0px;
	font-size: 25px;
}

#side-menu ul {
	list-style: none;
	margin: 0px;
	padding: 0px;
}

#side-menu a {
	padding: 15px 20px;
	text-decoration: none;
	color: #fff;
	font-weight: bold;
	font-size: 16px;
	display: block;
}

#side-menu .glyphicon {
	margin-right: 6px;
}

#side-menu a:hover {
	background-color: #000;
	color: #fff;
	display: block;
}

#side-menu .active a {
	color: #fff;
	background-color: #293846;
}

#side-menu .settings-btn {
	background-color: #1ab394;
}

#side-menu .settings-btn a {
	color: #fff;
}

#side-menu .settings-btn a:hover {
	background-color: #1ab394;
}

#side-menu .collapseable li {
	padding-left: 20px;
	padding-top: 5px;
}

#side-menu .collapseable a {
	color: #9fb1c2;
	font-size: 13px;
	padding: 5px 10px;
	text-decoration: none;
	display: block;
}

#side-menu .collapseable a:hover {
	color: #fff;
}

#side-menu .collapseable {
	border-left: 4px solid #1ab394;
	background-color: #293846;
}

#side-menu .link>ul>li {
	padding-bottom: 10px;
}


/*-- side-menu end --*/

.display-table {
	display: table;
	padding: 0px;
	height: 100%;
	width: 100%;
}

.display-table-row {
	display: table-row;
	height: 100%;
}

.display-table-cell {
	display: table-cell;
	float: none;
	height: 100%;
}

.valign-top {
	vertical-align: top;
}

#nav-header {
	background-color: #000;
	border-bottom: 10px solid #fff;
}

#nav-header #header-search-field {
	padding-top: 17px;
	vertical-align: center;
	border: none;
	width: 300px;
	outline: none;
}

#nav-header ul {
	margin: 0px;
	padding: 0px;
	list-style: none;
	color: #676a6c;
}

#nav-header ul li {
	float: right;
	margin-left: 15px;
	padding: 17px 0px;
}

#nav-header ul .glyphicon {
	color: #676a6c;
}

.label-meassage {
	background-color: #1ab394;
}

#nav-header ul a {
	text-decoration: none;
}

#nav-header .logout {
	color: #676a6c;
}

#nav-header .logout:hover {
	color: #676a6c;
}

#nav-header #welcome {
	margin-right: 20px;
}

#nav-header ul .label {
	position: absolute;
	margin-top: -10px;
	margin-left: -5px;
}

#nav-header .fixed-width {
	width: 35px;
}

.navbar-default {
	background-color: #000;
}

.navbar-default .navbar-toggle {
	border-color: #1ab394;
	background-color: #1ab394;
}

.navbar-default .icon-bar {
	border: 1px white solid;
}

.navbar-default .navbar-toggle:hover {
	background-color: #1ab394;
}

.navbar-default .navbar-toggle:focus {
	background-color: #1ab394;
}

#admin-footer {
	position: absolute;
	width: 100%;
	bottom: 0px;
	background-color: #fff;
	padding: 10px;
	font-size: 12px;
	color: #676a6c;
}
<div class="container-fluid display-table">
<!-- start container-fluid -->
<div class="row display-table-row">
<!-- side menu -->
<div class="col-md-2 col-sm-1 hidden-xs display-table-cell valign-top" id="side-menu">
   <h1 class="hidden-xs hidden-sm">test</h1>
   <ul >
      <li  class="link">
         <a href="index.php">
         <span class="glyphicon glyphicon-th" aria-hidden="true"></span>
         <span class="hidden-sm hidden-xs">test1</span>
         </a>
      </li>
      <li  class="link">
         <a href="add.php">
         <span class="glyphicon glyphicon-th" aria-hidden="true"></span>
         <span class="hidden-sm hidden-xs">test2</span>
         </a>
      </li>
      <li class="link">
         <a href="#">
         <span class="glyphicon glyphicon-th" aria-hidden="true"></span>
         <span class="hidden-sm hidden-xs">test3</span>
         </a>
      </li>
   </ul>
</div>

codepen.io

0 个答案:

没有答案