Pen Settings

HTML

CSS

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

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

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

              
                <!-- Read the full post at https://jen4web.substack.com/p/icons -->

<div class="container">
  <h1>Accessible Icons in Navbars</h1>

  <h2>INSTRUCTIONS:</h2>
  <ol class="instructions">
    <li>Fork this CodePen</li>
    <li>Use <a href="https://fontawesome.com/" target="_blank">Font Awesome</a> (or another web icon set like <a href="https://useiconic.com/open" target="_blank">Iconic</a>) to create a navbar made with one or more icons.<br><em>Note: Font Awesome installed for you under Settings</em></li>
    <li>Adjust the icons for accessibility using text labels, sr-only classes, etc.</li>
  </ol>

  <h3>Styling tips from Erika</h3>
  <ul class="tips">
    <li><strong><a href="https://fontawesome.com/v5.15/how-to-use/on-the-web/referencing-icons/basic-use">Read the Docs</a> </strong>for Font Awesome to save yourself some effort.<br>For example, <a href="https://fontawesome.com/v5.15/how-to-use/on-the-web/styling/sizing-icons">classes to resize the icons</a> come with the CSS - no need to reinvent the wheel.</li>
    <li>Don't forget to create a <strong>roll-over effect on hover</strong> as the icons are serving as links in our challenge today.</li>
  </ul>

  <p><a href="https://jen4web.substack.com/p/icons-discussion" target="_blank" class="button">Share your answer on Substack</a></p>
</div>

<hr><!-- Mess with anything below this line or in the CSS column! -->

<!-- Topic -->
<!--
<h1><a href="https://en.wikipedia.org/wiki/Avatar:_The_Last_Airbender">Avatar the Last Airbender</a></h1>
<h2><a href="https://youtu.be/d1EnW4kn1kg">Opening Sequence</a></h2>
-->

<nav>
  <ul>
    <li><a href="#">Earth</a></li>
    <li><a href="#">Air</a></li>
    <li><a href="#">Water</a></li>
    <li><a href="#">Fire</a></li>
  </ul>
</nav>


              
            
!

CSS

              
                body {
 background: url(https://thecandidclark.files.wordpress.com/2020/07/6e2e70faf81ceefee9250de4d0ee1fbd.jpg) no-repeat center center fixed;
  background-size: cover;
}





/* default styling for the page & instructions - you don't need to touch this unless you really want to */
html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}
body {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.2rem;
  padding-bottom: 5.0em;
}
.container {
  background-color: rgba(255,255,255,0.8); 
  width: 90%;
  padding: 0.5rem 1.5rem 0;
}
h1 {
  margin-top: 50px;
}
.instructions li {
  padding-bottom: 1.0rem;
}
.tips li {
  padding-bottom: 1.0rem;
  font-size: smaller;
}
.button {
  background-color: #eb3b5a;
  padding: 0.5rem 1rem;
  border: 1px solid #eb3b5a;
  border-radius: 30px;
  color: white;
  text-decoration: none;
  font-weight: bold;
  display: inline-block;
  margin: 1em 0 5rem;
  transition: all 1s ease;
}
.button:hover {
  color: #eb3b5a;
  background-color: white;
}
              
            
!

JS

              
                /* 

💯 This challenge is certified 90% free of JavaScript. 

ALL THE GOOD STUFF IS IN THE HTML AND CSS BLOCKS :-D

*/
              
            
!
999px

Console