html - 无法分离项目无序列表和按钮
问题描述
我不知道如何描述这个问题。我正在使用三个样式框架 Bootstrap、Semantic 和 Materialize CSS。我创建了一个无序列表,之后有一个按钮,当我使用br
标签将它们分开时,分离工作但间隙没有填充主体背景颜色,所以我使用了边距,但仍然没有填充主体颜色.
HTML 代码
<section>
<div class="container dashboard ">
<div class="row">
<aside class="col-sm-3">
<ul class="list-group text-center">
<a class="list-group-item active" href="#">Dashboard</a>
<a class="list-group-item" href="#">All Posts</a>
<a class="list-group-item" href="#">Create/Edit Posts</a>
</ul>
<a class="btn btn-light btn-block" href="#"> <i class="fa fa-power-off"></i> <span class="text">Log out</span> </a>
</aside>
</div>
</div>
</section>
CSS
.dashboard{
margin-top: 100px;
margin-bottom: 100px;
padding: 30px 0px;
}
.dashboard .col-sm-3{
border-bottom: none;
border-radius: 5px;
height: fit-content;
padding-left: 0;
padding-right: 0;
background: #fff;
}
.dashboard .col-sm-3 ul a{
text-decoration: none;
font-weight: 500;
}
.dashboard .col-sm-3 .btn {
margin-top: 50px;
}
.btn-light {
background-color: #fff;
border-color: #e4e4e4;
text-align: center;
}
.btn-light span{
text-transform: none;
font-weight: 500;
}
解决方案
你可以检查这个问题这个东西会帮助你链接
实际上,这个问题对我也有帮助,我也遇到过类似的情况。
我会让这个更简单我认为这个工作你可以试试这个
br {
content: "A" !important;
background: #fafafa !important;
display: block !important;
width: 100% !important;
height: 30px !important;
}
推荐阅读
- excel - 尽管有日期值,字符串日期未转换为日期类型
- jsf - Primefaces 8 ajax状态在p:dataTable分页后没有隐藏
- javascript - Dropbox Upload Javascript:TypeError:“在未实现接口 Window 的对象上调用了'fetch'。”
- javascript - JavaScript:仅检测浏览器关闭事件而不是标签关闭和刷新?
- python - Python Sympy 几个波的叠加
- c++ - 外部库不起作用(C/C++)Visual Studio 代码
- flutter - Flutter 在 Isolate 上通过 DIO 包上传视频
- ios - 转义闭包捕获非转义参数“完成”(Swift 5)
- angular - 我无法正确共享我的 Observable 流并且我的 http 请求调用了两次
- google-apps-script - 用于 Gmail 的 Google 应用程序脚本 - 收件箱中损坏的电子邮件