content logo

Bootstrap Tabs:

Red and Balck Tabs Style with Fading Effect using Bootstrap

Elements with the same color theme can be used on websites with bright and red themes. In this code, we also have a tab with a red and white theme. Fever is normally black and when you select one of the tabs, the fever turns red. The title of the tabs is white but the text is black. The background of the texts is white. There is a border around the text, which is thicker at the top and bottom of the text and its color is red. Tabs also include icons. Each tab that is selected creates a small triangle below that tab towards the texts.

#Bootstrap Simple Tabs #Free CSS Tabs #HTML Tabs Code #Bootstrap Red and Black Tabs #Bootstrap Tabs Fading Effect

<!-- This script got from www.frontendfreecode.com -->
<div class="container">
    <div class="row">
        <div class="col-md-offset-2 col-md-8">
            <div class="tab" role="tabpanel">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active">
                        <a href="#Section1" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-envelope-o"></i>Section 1</a>
                    </li>
                    <li role="presentation">
                        <a href="#Section2" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-cube"></i>Section 2</a>
                    </li>
                    <li role="presentation">
                        <a href="#Section3" aria-controls="settings" role="tab" data-toggle="tab"><i class="fa fa-comment"></i>Section 3</a>
                    </li>
                </ul>
                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane fade in active" id="Section1">
                        <h2>Section 1</h2>
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium, metus et scelerisque dignissim, ligula est imperdiet nisl, sit amet malesuada nunc felis in nisi. Nullam dapibus ligula dui, in rhoncus
                            purus euismod nec. Duis in lacinia neque. Etiam tellus.
                        </p>
                    </div>

                    <div role="tabpanel" class="tab-pane fade" id="Section2">
                        <h2>Section 2</h2>
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium, metus et scelerisque dignissim, ligula est imperdiet nisl, sit amet malesuada nunc felis in nisi. Nullam dapibus ligula dui, in rhoncus
                            purus euismod nec. Duis in lacinia neque. Etiam tellus.
                        </p>
                    </div>

                    <div role="tabpanel" class="tab-pane fade" id="Section3">
                        <h2>Section 3</h2>
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium, metus et scelerisque dignissim, ligula est imperdiet nisl, sit amet malesuada nunc felis in nisi. Nullam dapibus ligula dui, in rhoncus
                            purus euismod nec. Duis in lacinia neque. Etiam tellus.
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div><a style="font-size: 8pt; text-decoration: none" target="_blank" href="http://www.frontendfreecode.com">Frontend Free Code</a>
                                                                            
body {
    margin: 20px;
}
.tab .nav-tabs > li {
    margin-right: 2px;
}
.tab .nav-tabs > li > a {
    border: none;
    padding: 18px 25px;
    color: #fff;
    background: #272e38;
    border-radius: 0;
}
.tab .nav-tabs > li > a > i {
    font-size: 14px;
    margin-right: 10px;
}
.tab .nav-tabs > li.active > a,
.tab .nav-tabs > li.active > a:focus,
.tab .nav-tabs > li.active > a:hover {
    border: none;
    background: #e74c3c;
    color: #fff;
    transition: background 0.2s linear;
}
.tab .nav-tabs li.active:after {
    content: "";
    position: absolute;
    bottom: -30px;
    left: 37%;
    border: 15px solid transparent;
    border-top-color: #e74c3c;
}
.tab .tab-content {
    background: #fdfdfd;
    line-height: 25px;
    border: 1px solid #ddd;
    border-top: 5px solid #e74c3c;
    border-bottom: 5px solid #e74c3c;
    padding: 30px 25px;
}
@media only screen and (max-width: 480px) {
    .tab > .nav-tabs li {
        width: 100%;
    }
    .tab .nav-tabs > li > a {
        padding: 20px;
    }
    .tab .nav-tabs > li.active:after {
        border: none;
    }
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- This script got from www.frontendfreecode.com -->

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style>
body {
    margin: 20px;
}
.tab .nav-tabs > li {
    margin-right: 2px;
}
.tab .nav-tabs > li > a {
    border: none;
    padding: 18px 25px;
    color: #fff;
    background: #272e38;
    border-radius: 0;
}
.tab .nav-tabs > li > a > i {
    font-size: 14px;
    margin-right: 10px;
}
.tab .nav-tabs > li.active > a,
.tab .nav-tabs > li.active > a:focus,
.tab .nav-tabs > li.active > a:hover {
    border: none;
    background: #e74c3c;
    color: #fff;
    transition: background 0.2s linear;
}
.tab .nav-tabs li.active:after {
    content: "";
    position: absolute;
    bottom: -30px;
    left: 37%;
    border: 15px solid transparent;
    border-top-color: #e74c3c;
}
.tab .tab-content {
    background: #fdfdfd;
    line-height: 25px;
    border: 1px solid #ddd;
    border-top: 5px solid #e74c3c;
    border-bottom: 5px solid #e74c3c;
    padding: 30px 25px;
}
@media only screen and (max-width: 480px) {
    .tab > .nav-tabs li {
        width: 100%;
    }
    .tab .nav-tabs > li > a {
        padding: 20px;
    }
    .tab .nav-tabs > li.active:after {
        border: none;
    }
}
</style>

</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-offset-2 col-md-8">
            <div class="tab" role="tabpanel">
                <!-- Nav tabs -->
                <ul class="nav nav-tabs" role="tablist">
                    <li role="presentation" class="active">
                        <a href="#Section1" aria-controls="home" role="tab" data-toggle="tab"><i class="fa fa-envelope-o"></i>Section 1</a>
                    </li>
                    <li role="presentation">
                        <a href="#Section2" aria-controls="profile" role="tab" data-toggle="tab"><i class="fa fa-cube"></i>Section 2</a>
                    </li>
                    <li role="presentation">
                        <a href="#Section3" aria-controls="settings" role="tab" data-toggle="tab"><i class="fa fa-comment"></i>Section 3</a>
                    </li>
                </ul>
                <!-- Tab panes -->
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane fade in active" id="Section1">
                        <h2>Section 1</h2>
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium, metus et scelerisque dignissim, ligula est imperdiet nisl, sit amet malesuada nunc felis in nisi. Nullam dapibus ligula dui, in rhoncus
                            purus euismod nec. Duis in lacinia neque. Etiam tellus.
                        </p>
                    </div>

                    <div role="tabpanel" class="tab-pane fade" id="Section2">
                        <h2>Section 2</h2>
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium, metus et scelerisque dignissim, ligula est imperdiet nisl, sit amet malesuada nunc felis in nisi. Nullam dapibus ligula dui, in rhoncus
                            purus euismod nec. Duis in lacinia neque. Etiam tellus.
                        </p>
                    </div>

                    <div role="tabpanel" class="tab-pane fade" id="Section3">
                        <h2>Section 3</h2>
                        <p>
                            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium, metus et scelerisque dignissim, ligula est imperdiet nisl, sit amet malesuada nunc felis in nisi. Nullam dapibus ligula dui, in rhoncus
                            purus euismod nec. Duis in lacinia neque. Etiam tellus.
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div><div id="bcl"><a style="font-size:8pt;text-decoration:none;" href="http://www.devanswer.com">Frontend Free Code</a></div>

</body>
</html>
Preview