html - HTML、CSS 中的侧边栏问题
问题描述
我有以下代码应该可以工作,但是
我必须在这里写更多的细节,所以这个提交通过,因为有很多代码。您可以忽略此部分。谢谢你的帮助。
@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,400i,500');
body {
overflow-x: hidden;
font-family: 'Roboto', sans-serif;
font-size: 16px;
}
/* Toggle Styles */
#viewport {
padding-left: 250px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#content {
width: 100%;
position: relative;
margin-right: 0;
}
/* Sidebar Styles */
#sidebar {
z-index: 1000;
position: fixed;
left: 250px;
width: 250px;
height: 100%;
margin-left: -250px;
overflow-y: auto;
background: #37474F;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
#sidebar header {
background-color: #263238;
font-size: 20px;
line-height: 52px;
text-align: center;
}
#sidebar header a {
color: #fff;
display: block;
text-decoration: none;
}
#sidebar header a:hover {
color: #fff;
}
#sidebar .nav{
}
#sidebar .nav a{
background: none;
border-bottom: 1px solid #455A64;
color: #CFD8DC;
font-size: 14px;
padding: 16px 24px;
}
#sidebar .nav a:hover{
background: none;
color: #ECEFF1;
}
#sidebar .nav a i{
margin-right: 16px;
}
<!doctype html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
</head>
<body>
<div id="viewport">
<!-- Sidebar -->
<div id="sidebar">
<header>
<a href="#">Plan Builder</a>
</header>
<ul class="nav">
<li>
<a href="#">
<i class="zmdi zmdi-view-dashboard"></i> Dashboard
</a>
</li>
<li>
<a href="#">
<i class="zmdi zmdi-link"></i> Shortcuts
</a>
</li>
<li>
<a href="#">
<i class="zmdi zmdi-widgets"></i> Overview
</a>
</li>
<li>
<a href="#">
<i class="zmdi zmdi-calendar"></i> Events
</a>
</li>
<li>
<a href="#">
<i class="zmdi zmdi-info-outline"></i> About
</a>
</li>
<li>
<a href="#">
<i class="zmdi zmdi-settings"></i> Services
</a>
</li>
<li>
<a href="#">
<i class="zmdi zmdi-comment-more"></i> Contact
</a>
</li>
</ul>
</div>
<!-- Content -->
<div id="content">
@include('inc\navbar')
</div>
</nav>
<main class="py-4">
@yield('content')
</main>
@include('inc\footer')
</div>
</div>
</body>
</html>
解决方案
推荐阅读
- git - git push 失败,因为没有要求登录令牌
- c# - ASP.NET Core Runtime deploymenet 证书信任
- google-drive-api - Google 数据工作室报告:获取页面 ID
- python - 在 VS shell 中仍然无法识别 python cmd
- php - PHP通过3个函数级联(传递)后续返回
- python - Python:在 Plotly 中的图形上方创建注释空间
- php - 当其中一个为空时隐藏 ACF 字段
- html - BS4 轮播指示器在点击时突出显示错误的图像(活动)
- r - 如何强制阅读器考虑正确的小数/分组标记?
- python - 具有简化类创建规则的 Python 预处理器(领域特定语言)