<div id="back"></div>
<div class="star-1 stars"></div>
<div class="star-2 stars"></div>
<div class="star-3 stars"></div>
  .stars {
    background-color: white;
    height: 30px;
    width: 30px;
    border-radius: 50%;
    animation-iteration-count: infinite;
  }

  .star-1 {
    margin-top: 15vh; 
    margin-left: 35%;
    animation-name: twinkle-1;
    animation-duration: 1.1s;
  }

  .star-2 {
    margin-top: 5vh;
    margin-left: 65%;
    animation-name: twinkle-2;
    animation-duration: 1s;
  }
  .star-3 {
      margin-top: 5vh;
      margin-left: 50%;
      animation-name: twinkle-2;
      animation-duration: 1.2s;
    }

  @keyframes twinkle-1 {
    50% {
      transform: scale(0.3);
      opacity: 0.3;
    }
  }

  @keyframes twinkle-2 {
    20% {
      transform: scale(0.5);
      opacity: 0.5;
    }
  }

  #back {
    position: fixed;
    padding: 0;
    margin: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(black, #000099, #66c2ff, #ffcccc, #ffeee6);
  }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.