Bootstrap 4 .card-header-tabs class

BootstrapWeb DevelopmentCSS Framework

Use the card-header-tabs in Bootstrap to style navigation links in card header −

<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>

The header tabs are set on Unordered List using nav-tabs and card-header-tabs class as shown above −

<ul class="nav nav-tabs card-header-tabs">

Let us see an example to learn how to create Bootstrap 4 card header − 

Example

Live Demo

<!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>
raja
Published on 20-Jul-2018 12:13:16
Advertisements