Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <html lang="en">

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Cookie Consent Box</title>

  <div class="wrapper">
    <img src="" alt="cookie" />
    <div class="content">
      <header>Cookies Consent</header>
      <p>We use our own and third-party cookies to personalize content and to analyze web traffic.</p>
      <div class="buttons">
        <button class="item">Accept</button>
        <a href="#" class="item">Reject</a>



                * {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #212529;
  min-height: 100vh;

.wrapper {
  position: absolute;
  max-width: 365px;
  background: #fff;
  border: 5px solid #fca311;
  padding: 25px 25px 30px 25px;
  border-radius: 15px;
  box-shadow: 1px 7px 14px -5px rgba(0, 0, 0, 0.15);
  text-align: center;
.wrapper.hide {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
  transition: all 0.3s ease;
::selection {
  color: #fff;
  background: #212529;
.wrapper img {
  max-width: 90px;
.content header {
  font-size: 25px;
  font-weight: 600;
.content {
  margin-top: 10px;
.content p {
  text-align: justify;
  color: #858585;
  margin: 5px 0 20px 0;
.content .buttons {
  display: flex;
  align-items: center;
  justify-content: center;
.buttons button {
  padding: 10px 20px;
  border: none;
  outline: none;
  color: #212529;
  font-size: 16px;
  font-weight: 500;
  border-radius: 5px;
  background: #fcba7f;
  cursor: pointer;
  transition: all 0.3s ease;
.buttons button:hover {
  transform: scale(0.97);
.buttons .item {
  margin: 0 10px;
.buttons a {
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  color: #212529;
  background: #e9ecef;



                const cookieBox = document.querySelector(".wrapper"),
  acceptBtn = cookieBox.querySelector("button");
acceptBtn.onclick = () => {
  document.cookie = "CookieBy=FaridVatani; max-age=" + 60 * 60 * 24 * 30;
  if (document.cookie) {
  } else {
      "Cookie can't be set! Please unblock this site from the cookie setting of your browser."
let checkCookie = document.cookie.indexOf("CookieBy=FaridVatani");
checkCookie != -1
  ? cookieBox.classList.add("hide")
  : cookieBox.classList.remove("hide");