我正在使用管理模板CoreUI。我的布局是页面https://coreui.io/v1/docs/layout/options/
中所述的基本布局我正在尝试在右侧的 aside菜单中打开 Float (浮动在主要内容上),而不是内联地减小main的宽度。
我尝试删除固定在侧面的菜单,添加浮动在侧面或绝对的菜单,但这不起作用。
是否有一种无需修改CoreUI css的方法?
下面的代码段,但在SO上不起作用
.app-header{background-color:#4B8BF4}
.sidebar{background-color:#FFCD42}
.app-footer{background-color:#DD4F43}
.aside-menu{background-color:#19A15F}
.main{background-color:#EEE}
<link href="https://cdn.jsdelivr.net/npm/@coreui/coreui@2.1.7/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdn.jsdelivr.net/npm/@coreui/coreui@2.1.7/dist/css/coreui.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@coreui/coreui@2.1.7/dist/js/coreui.min.js"></script>
<body class="app header-fixed sidebar-fixed aside-menu-fixed sidebar-lg-show">
<header class="app-header navbar">
<!-- Header content here -->
<h2>I'm the header!</h2>
</header>
<div class="app-body">
<div class="sidebar">
<!-- Sidebar content here -->
<nav class="sidebar-nav">
<ul class="nav">
<li class="nav-item">
<a class="nav-link" href="index.html">
<i class="nav-icon icon-speedometer"></i> Dashboard
</a>
</li>
<li class="nav-title">Settings</li>
</ul>
</nav>
</div>
<main class="main">
<h1>I'm the main content...</h1>
</main>
<aside class="aside-menu">
<!-- Aside menu content here -->
</aside>
</div>
<footer class="app-footer">
<!-- Footer content here -->
</footer>
</body>
答案 0 :(得分:0)
body
元素:
aside-menu-off-canvas
aside-menu-fixed
hth