Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

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

Packages

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.

Behavior

Save Automatically?

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

              
                <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap" rel="stylesheet">

<div class="wrapper">
  <header>
    <ul class="menu">
    <li><a href="">About</a></li>
    <li><a href="">Albums</a></li>
    <li><a href="">Tours</a></li>
    <li><a href="">Ticket</a></li>
    <li><a href="">Photos</a></li>
  </ul>
  </header>
  <main>
  <article class="">
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto molestias voluptate magnam aliquid excepturi et quod autem inventore quam. Nisi impedit, voluptates consequatur autem earum quaerat magni? Quam necessitatibus, a eos hic aliquid accusamus omnis <a>deserunt illo</a> qui eligendi officiis accusantium est. Assumenda maiores repellat ratione atque non rerum nulla, quidem, odio aut illo deleniti, nihil corporis. Blanditiis ipsum quia quis nulla, quisquam quod! Molestiae totam amet at eaque voluptas <a>saepe vel</a> omnis molestias minima quisquam? Quaerat, accusantium praesentium officiis assumenda dicta reprehenderit repellendus eligendi est. Dolore veniam hic voluptatem labore ea illo debitis distinctio, nam cupiditate tenetur eligendi similique.</p>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Architecto molestias voluptate magnam aliquid excepturi et quod autem inventore quam. Nisi impedit, voluptates consequatur <a>autem</a> earum quaerat magni? Quam necessitatibus, a eos hic aliquid accusamus omnis deserunt illo qui eligendi officiis accusantium est. Assumenda maiores repellat ratione atque non rerum nulla, quidem, odio aut illo deleniti, nihil corporis. Blanditiis ipsum <a>quia</a> quis nulla, quisquam quod! Molestiae totam amet at eaque voluptas saepe vel omnis molestias minima quisquam? Quaerat, accusantium praesentium officiis assumenda dicta reprehenderit repellendus eligendi est. Dolore veniam hic voluptatem labore ea illo debitis distinctio, nam cupiditate tenetur eligendi similique.</p>
  </article>
</main>
</div>
              
            
!

CSS

              
                * {
  color: RGB(80,149,191);
}

body {
  margin: 0;
}

.wrapper {
  background-color: RGB(3,0,91);
/*   background-color: RGBA(45,24,138,0.84); */
}

header {
  background-color: rgba(50,50,50,0.4);
  padding: 10px 0;
  box-shadow: 0px 3px 4px rgba(0,0,0,0.3);
}

.menu {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
}

.menu li {
  flex: 1 0 0;
  list-style: none;
}

li a {
  padding: 8px;
  text-decoration: none;
  color: snow;
  font-family: 'Bebas Neue', cursive;
  font-size: 24px;
  line-height: 2.5;
  text-transform: uppercase;
  posiiton: absolute;
  z-index: 2;
}

section {
  max-width: 600px;
  margin: 0 auto;
}

main {
  padding-top: 15px;
  height: 100vh;
}


h2 {
  margin: 0;
  text-align: center;
}

article {
  width: 60%;
  margin: 0 auto;
}

article a {
  display: inline-block;
  padding: 2px;
}

.spotlight {
  transition: all .5s;
  position: absolute;
  top: 0;
  left: 0;
  background: RGBA(255,255,47, 0.6);
  display: block;
  z-index: 1;
  border-radius: 30px;  
}



              
            
!

JS

              
                const spotlight = document.createElement('span')
document.body.append(spotlight)
spotlight.classList.add('spotlight')

const links = document.querySelectorAll('a')

function highlightLink() {
  const linkInfo = this.getBoundingClientRect();
  const coordinate = {
    width: linkInfo.width,
    height: linkInfo.height,
    left: linkInfo.left + scrollX,
    top: linkInfo.top + scrollY,
  }
  spotlight.style.width = `${coordinate.width}px`;
  spotlight.style.height = `${coordinate.height}px`;
  spotlight.style.transform = `translate(${coordinate.left}px, ${coordinate.top}px)`;
}



links.forEach(link => {
  link.addEventListener('mouseenter', highlightLink);
})

              
            
!
999px

Console