使用card-link类可将悬浮效果和蓝色添加到卡中的任何链接。
以下是使用Bootstrap 4中的card-link类显示具有悬停效果的三个链接的代码片段-
<a href="#" class="card-link"> Website Development </a> <a href="#" class="card-link"> App Development (iOS) </a> <a href="#" class="card-link"> App Development (Android) </a>
尝试以下代码来实现card-link类-
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>Services</h2> <div class="card"> <div class="card-body"> <h4 class="card-title">Company</h4> <p class="card-text">We provide the following tech development services:</p> <a href="#" class="card-link">Website Development</a> <a href="#" class="card-link">App Development (iOS)</a> <a href="#" class="card-link">App Development (Android)</a> </div> </div> </div> </body> </html>