Skip to content

kolappannathan/bootstrap-cookie-banner

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
Nov 19, 2021
Jul 28, 2020
Jun 12, 2022

Bootstrap cookie banner

A cookie banner for websites using Bootstrap 5.

Demo: Live demo

Bootstrap Version used: 5.1.3

Usage

  1. Include the CSS and js files.
<!-- Cookie Banner -->
<link rel="stylesheet" href="./src/cookie-banner.css">
<script async src="./src/cookie-banner.js"></script>
  1. Minimum HTML to make it work
<!-- Cookie Banner -->
<div id="cb-cookie-banner" class="alert alert-dark text-center mb-0" role="alert">
  &#x1F36A; This website uses cookies to ensure you get the best experience on our website.
  <a href="https://www.cookiesandyou.com/" target="blank">Learn more</a>
  <button type="button" class="btn btn-primary btn-sm ms-3" onclick="window.cb_hideCookieBanner()">
    I Got It
  </button>
</div>
<!-- End of Cookie Banner -->

Screenshot

Demo image