Bootstrap 4 .card-header-tabs 类
使用 Bootstrap 中的 card-header-tabs 来设置卡片标题中的导航链接 −
<div class="card-header"> <ul class="nav nav-tabs card-header-tabs"> <li class="nav-item"> <a class="nav-link active" href="#">Drupal Commerce</a> </li> <li class="nav-item"> <a class="nav-link" href="#">WooCommerce</a> </li> </ul> </div>
标题选项卡设置在无序列表上,使用 nav-tabs 和如上所示的 card-header-tabs 类 −
<ul class="nav nav-tabs card-header-tabs">
我们学习一个示例来了解如何创建 Bootstrap 4 card 标头 −
示例
<!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://ajax.googleapis.com/ajax/libs/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>E-commerce Technologies</h2> <div class="card"> <div class="card-header"> <ul class="nav nav-tabs card-header-tabs"> <li class="nav-item"> <a class="nav-link active" href="#">Drupal Commerce</a> </li> <li class="nav-item"> <a class="nav-link" href="#">WooCommerce</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Prestashop</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Shopify</a> </li> </ul> </div> <div class="card-body"> <h5 class="card-title">Add title here</h5> <p class="card-text">Add content here</p> </div> </div> </div> </body> </html>
广告