<div class="cookie-policy">
  <p class="cookie-policy__content">This website is using cookies. We use them to give you the best experience. If you continue using our website, we'll assume that you are happy to receive all cookies on this website.</p>
  <a href="#" class="cookie-policy__continue">Continue</a>
  <a href="#" class="cookie-policy__learn">Learn more</a>
</div>
.cookie-policy {
  $c: &;
  position: absolute;
  bottom: 0;
  display: none;
  padding: 20px;
  width: 100%;
  background-color: rgba(0,0,0,0.8);
  color: #fff;
  align-items: center;
  box-sizing: border-box;
  
  &__content {
    flex-grow: 1;
    padding-right: 25px;
    line-height: 1.4;
  }
  
  &__continue {
    padding: 10px 20px;
    margin-right: 15px;
    border: 1px solid white;
    border-radius: 40px;
    text-decoration: none;
    color: #fff;
    
    &:focus,
    &:hover {
      background-color: rgba(255,255,255,1);
      color: #333;
    }
  }
  
  &__learn {
    display: block;
    flex-shrink: 0;
    color: rgba(255,255,255,0.5);
    
    &:focus,
    &:hover {
      color: #fff;
    }
  }
  
  @media screen and (max-width: 560px) {
    flex-direction: column;
    text-align: center;
    
    #{$c}__content {
      margin-bottom: 25px;
    }
    
    #{$c}__continue {
      margin-right: 0;
      margin-bottom: 15px;
    }
  }
}
View Compiled
var $cookiePolicy = $('.cookie-policy');
var $btnContinue = $cookiePolicy.find('.cookie-policy__continue');
var cookieName = "agree_cookies";

function setCookie(cname, cvalue, exdays) {
  var d = new Date();
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
  var expires = "expires=" + d.toUTCString();
  document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
  console.log(cname + "=" + cvalue + ";" + expires + ";path=/")
}

function getCookie(cname) {
  var name = cname + "=";
  var decodedCookie = decodeURIComponent(document.cookie);
  var ca = decodedCookie.split(';');

  for (var i = 0; i < ca.length; i++) {
    var c = ca[i];
    while (c.charAt(0) == ' ') {
      c = c.substring(1);
    }
    if (c.indexOf(name) == 0) {
      return c.substring(name.length, c.length);
    }
  }
  return "";
}

var hide = function() {
  setCookie('agree_cookies', true, 9999);
  $cookiePolicy.css({display: "none"});
}

if (getCookie('agree_cookies') == "") {
  $cookiePolicy.css({display: "flex"});
  $btnContinue.on('click', hide);
}

console.log(document.cookie);
  

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js