要添加悬停效果,请使用Bootstrap中的card-link类。
以下是使用card-link类的链接-
<a href="#" class="card-link">XAMPP (MySQL + PHP + Apache)</a> <a href="#" class="card-link">WordPress</a>
上面的所有代码都在card-body类中使用-
<div class="card-body"> <h4 class="card-title">WordPress Installation</h4> <p class="card-text">To work with WordPress, you need the following</p> <a href="#" class="card-link">XAMPP (MySQL + PHP + Apache)</a> <a href="#" class="card-link">WordPress</a> </div>
您可以尝试运行以下代码以在Bootstrap 4卡内添加悬停效果-
<!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>Requirement - WordPress</h2> <div class="card"> <div class="card-body"> <h4 class="card-title">WordPress Installation</h4> <p class="card-text">To work with WordPress, you need the following</p> <a href="#" class="card-link">XAMPP (MySQL + PHP + Apache)</a> <a href="#" class="card-link">WordPress</a> </div> </div> </div> </body> </html>