How to disable tabs in Bootstrap?

How to disable tabs in Bootstrap?

Asked on November 1, 2018 in Bootstrap.
Add Comment

  • 1 Answer(s)

        Tabs in bootstrap can be disabled by removing attribute data-toggle=”tab” from Tabs.

        And then we can add the class .disabled to the parent <li> element to make it look like disabled visually.
    For example:

    <!DOCTYPE html>
    <html lang="en">
    <meta charset="UTF-8">
    <title>Disable Clicks on Bootstrap Tabs</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/bootstrap-theme.min.css">
    <script src=""></script>
    <script src="js/bootstrap.min.js"></script>
        <ul class="nav nav-tabs">
            <li class="active"><a data-toggle="tab" href="#home">Home</a></li>
            <li><a data-toggle="tab" href="#profile">Profile</a></li>
            <li class="disabled"><a href="#admin">Admin</a></li>
        <div class="tab-content">
            <div id="home" class="tab-pane fade in active">
                <p>Aliquip placeat salvia cillum iphone...</p>
            <div id="profile" class="tab-pane fade">
                <p>Vestibulum nec erat eu nulla rhoncu non neque...</p>
            <div id="admin" class="tab-pane fade">
                <p>Sed consequat ante in rutrum convallis...</p>
    Answered on November 1, 2018.
    Add Comment

  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.