<!--link to bootstrap 5 script and styles-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<!-- bootstrap 5 card with no borders without modifying your .css-->
<!--attention to the border-0 class below-->
<div class="card border-0">
<div class="card-body">
<h1 class="display-1">Card With No Borders!</h1>
<p class="card-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum dui arcu, eu aliquet odio elementum non. Curabitur vel mi ligula. In vel dolor diam. Curabitur ornare, magna eget ultrices luctus, magna lectus tempus dui, non facilisis elit dolor eu risus. </p>
<a href="#" class="btn btn-primary">A Button</a>
</div>
</div>
3条答案
按热度按时间clj7thdc1#
检查
.card
类是否具有border
要删除它,只需将其重写为
border: none;
即可eqzww0vc2#
请尝试使用此代码:
看看能不能解决问题
kpbpu0083#
Bootstrap 5有一个单独的类
border-0
。尝试运行下面的代码,看看它是如何工作的。
更多关于Bootstrap here中的边框。希望这对您有帮助:)