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

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

              
                <button class="openglossary" aria-label="By clicking this button you will make the Glossary available">Show Glossary</button>
<section class="glossarySection">
<h1>Glossary</h!><button class="close" aria-label="close the glossary">X</button>
<div class="glossary">
<ul class="glossaryLetters">
  <li><button class='letter selectedLetter' aria-label="Glossary letter A">A</button></li><li><button class='letter' aria-label="Glossary letter B">B</button></li><li><button class='letter' aria-label="Glossary letter C">C</button></li><li><button class='letter' aria-label="Glossary letter D">D</button></li><li><button class='letter' aria-label="Glossary letter E">E</button></li><li><button class='letter' aria-label="Glossary letter F" disabled>F</button></li><li><button class='letter' aria-label="Glossary letter G">G</button></li><li><button class='letter' aria-label="Glossary letter H">H</button></li><li><button class='letter' aria-label="Glossary letter I">I</button></li><li><button class='letter' aria-label="Glossary letter J" disabled>J</button></li><li><button class='letter' aria-label="Glossary letter K" disabled>K</button></li><li><button class='letter' aria-label="Glossary letter L">L</button></li><li><button class='letter' aria-label="Glossary letter M" disabled>M</button></li><li><button class='letter' aria-label="Glossary letter N" disabled>N</button></li><li><button class='letter' aria-label="Glossary letter O" disabled>O</button></li><li><button class='letter' aria-label="Glossary letter P">P</button></li><li><button class='letter' aria-label="Glossary letter Q" disabled>Q</button></li><li><button class='letter' aria-label="Glossary letter R" disabled>R</button></li><li><button class='letter' aria-label="Glossary letter S">S</button></li><li><button class='letter' aria-label="Glossary letter T">T</button></li><li><button class='letter' aria-label="Glossary letter U" disabled>U</button></li><li><button class='letter' aria-label="Glossary letter V">V</button></li><li><button class='letter' aria-label="Glossary letter W">W</button></li><li><button class='letter' aria-label="Glossary letter X" disabled>X</button></li><li><button class='letter' aria-label="Glossary letter Y" disabled>Y</button></li><li><button class='letter' aria-label="Glossary letter Z" disabled>Z</button></li> 
</ul>
<div class="glossaryContent">
   <dl
      id="letterA_content"
      title="Glossary terms for       Letter A"       
      class="letter_content currentLetter_content">  <dt>Accessibility</dt>
  <dd>
    <p>The measure of a web page's usability by persons with one or more disabilities.</p>
  </dd>
   <dt>Alternative Text</dt>
 <dd>
    <p>
Short text used described images---usually 125 characters or less.</p>
  </dd>

   <dt>Assistive technologies</dt>
 <dd>
    <p>
Technologies (software or hardware) that increase, maintain, or improve the functional capabilities of individuals with disabilities when interacting with computers or computer-based systems.</p>
  </dd>
    <dt>Audio browsers</dt>
    <dd>Web browsers that provides a text-to-speech capability for the blind and visually impaired.</dd>
    </dl>
    <dl title="Glossary terms for       Letter B"       
      id="letterB_content"
      class="letter_content">  <dt>Braille terminal</dt>
  <dd>
    <p>Machines that convert text on a screen to braille by raising bumps through holes on a flat surface.</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter C"       
      id="letterC_content"
      class="letter_content">  <dt>Captioning</dt>
  <dd>
    <p>The art of adding captions to a television program or movie.</p>
  </dd>
    <dt>Captions</dt>
  <dd>
    <p>A textual representation of sounds--usually associated with television programming or movies; captions are meant to display in real time and to capture speech sounds and sounds beyond speech in some cases. </p>
  </dd>
     <dt>Clickability cues</dt>
  <dd>
    <p>      
A visual indication that a given word or item on a Web page is clickable. Cues that can be used to indicate the clickability of an item include color, underlining, bullets, and arrows.
    </p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter D"       
      id="letterD_content"
       class="letter_content">  <dt>Disability</dt>
  <dd>
    <p>A limitation in an ability</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter E"       
      id="letterE_content"
       class="letter_content">  <dt>Early Adopters</dt>
  <dd>
    <p>
      A user who has a tendency to embrace new technology before the majority.
    </p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter F"       
      id="letterF_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter G"       
      id="letterG_content"
       class="letter_content">  <dt>Graceful Degradation</dt>
  <dd>
    <p>When a site utilizes new technology, if disabled, the content maintains effectiveness for the users. </p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter H"       
      id="letterH_content"
       class="letter_content">  <dt>Heat maps</dt>
  <dd>
    <p>Color-based representations of areas of interest/focus points; generally associated with eye-tracking software. </p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter I"       
      id="letterI_content"
       class="letter_content">  <dt>Internationalization</dt>
  <dd>
    <p>A system whose primary design has been developed to work in multiple languages and in the cultural contexts of different locales.</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter J"       
      id="letterJ_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter K"       
      id="letterK_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter L"       
      id="letterL_content"
       class="letter_content">  <dt>Late adopters</dt>
  <dd>
    <p>Individuals who are hestitant to adopt new technology.</p>
  </dd>
    <dt>Localization</dt>
  <dd>
    <p>Customizing or personalizing a national or international product for a local market.</p>
  </dd>
    <dt>Long Descriptions</dt>
  <dd>
    <p>Descriptions that are written for complex figures and tagged via the long desc attribute; though not currently supported by most Web browsers, the long desc attribute is a planned feature in the next iteration of Firefox.</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter M"       
      id="letterM_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter N"       
      id="letterN_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter O"       
      id="letterO_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter P"       
      id="letterP_content"
       class="letter_content">  <dt>Programmatic Focus </dt>
  <dd>
    <p>Where the computer's focus is on a Web page. </p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter Q"       
      id="letterQ_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter R"       
      id="letterR_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter S"       
      id="letterS_content"
       class="letter_content">  <dt>Screen reader</dt>
  <dd>
    <p>A software program used to allow reading of content and navigation of the screen using speech or Braille output. Used primarily by people who have difficulty seeing. JAWS and NVDA are examples.</p>
  </dd>
    <dt>Section 508 [see also 508]</dt>
  <dd>
    <p>Section 508 of the Rehabilitation Act was enacted to eliminate barriers in information technology, to make available new opportunities for people with disabilities, and to encourage development of technologies that will help achieve these goals. The law applies to all Federal agencies when they develop, procure, maintain, or use electronic and information technology. To learn more go to 508.gov.</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter T"       
      id="letterT_content"
       class="letter_content">  <dt>Transcript</dt>
  <dd>
    <p>A text only version of what's said in a movie or television program; they are not real time and they generally are limited to speech only; they are not a recommended substitute for captions.</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter U"       
      id="letterU_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter V"       
      id="letterV_content"
       class="letter_content">  <dt>Visual Focus </dt>
  <dd>
    <p>Where the user's focus is on a Web page; generally represented by a dashed box that appears around items on the page and associated with tabbing.</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter W"       
      id="letterW_content"
       class="letter_content">  <dt>WCAG 2.0 </dt>
  <dd>
    <p>The Web Content Accessibility Guidelines (WCAG) 2.0 is focused on providing an international technical standard for web content. It has 12 guidelines that are organized under four principles: perceivable, operable, understandable, and robust. The guidelines each have a testable success criteria, which are at three levels: A, AA, and AAA.</p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter X"       
      id="letterX_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter Y"       
      id="letterY_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
  <dl title="Glossary terms for       Letter Z"       
      class="letterZ_content"
       class="letter_content">  <dt></dt>
  <dd>
    <p></p>
  </dd>
  </dl>
    </div>
  </div>
  </div>
</section>
              
            
!

CSS

              
                h1, h2, h3, h4, h5 {
  font-family: Gentium Basic;
  font-weight: normal;
  font-style: normal;
}

button {
  font-family: Inknut Antiqua;
  font-weight: 700;
  font-style: normal;
  padding: 9px;
  letter-spacing: .2rem;
  font-variant: small-caps;
}

body {
  font-family: Quattrocento Sans;
  font-weight: normal;
  font-style: normal;
}

.glossarySection {
  display: none;
  position: relative;
  margin-top: 2rem;
  border: 1px solid #000;
  width: 75%;
  padding-left: 15px;
}

.letter, .close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    outline: inherit;
}

.letter:disabled {
  color: #c0c0c0;
}

.close {
  position: absolute;
  right: 10px;
  top: 5px;
  border: 1px solid #000;
  padding: 5px 6px 3px 8px;
  border-radius: 50%;
  font-size: 1rem;
}

.sr-only {
    position:absolute;
    left:-10000px;
    top:auto;
    width:1px;
    height:1px;
    overflow:hidden;
}

.glossary {
    display: grid;
    grid-template-columns: .15fr 1fr;
}

.glossaryLetters {
  margin-left: -2.4rem;
  margin-top: 1.25rem;
  list-style-type: none;
}

.glossaryLetters li {
  line-height: 2rem;
  font-weight: 800;
}

.hide {
  visibility: hidden;
}

.show {
  display: block;
}

.selectedLetter {
  text-decoration: solid underline navy .25rem;
}

.letter_content {
  display: none;
}

.currentLetter_content {
  display: block;
}
              
            
!

JS

              
                const state = {
  neverOpened: true,
  currentLetter: 'A'
} 
const openglossary = document.querySelector('.openglossary');
const glossarySectionElement = document.querySelector('.glossarySection');
const switchSelectedLetters = (target) => {
  const selector = "selectedLetter";
  const currentSelectedLetter = document.querySelector(`.${selector}`);
  currentSelectedLetter.classList.remove(selector);
  target.classList.add(selector);
}
const switchShowingLetterContent = (letter) => {
  const currentlyShowingLetter = document.querySelector('.currentLetter_content');
 currentlyShowingLetter.classList.remove('currentLetter_content');
  
  const letterToShow = document.getElementById(`letter${letter}_content`);
  letterToShow.classList.add('currentLetter_content');
}
const showGlossaryTerm = (e) => {
 const target = e.target;
 const letter = target.textContent;
  switchSelectedLetters(target);
  switchShowingLetterContent(letter);  
}

const openGlossarySection = () => {
 if (state.neverOpened) {
   const closeglossary = document.querySelector('.close');
   closeglossary.onclick = closeGlossarySection;
   //attach onclick handlers to all glossary buttons
   const glossaryLetter = document.querySelectorAll('.letter');
   glossaryLetter.forEach((letter) => {
  letter.onclick = showGlossaryTerm;
});
 } glossarySectionElement.classList.add('show');
  openglossary.classList.add("hide");
  
};

const closeGlossarySection = () => {
  glossarySectionElement.classList.remove('show');
  openglossary.classList.remove("hide");
};

  openglossary.onclick = openGlossarySection;

              
            
!
999px

Console