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

              
                <h1>Accessible Drop Caps</h1>

<div>
  <div>

    <h2>Incorrect</h2>
    <p>
      <span aria-labelledby="word--first" role="text">
        <span aria-hidden="true">
         <span class="dropcap">M</span>atthew
        </span>
        <span id="word--first" class="hidden">Matthew</span>
      </span>
      watched the storm, so beautiful yet terrific. Mist enveloped the ship three hours out from port. Waves flung themselves at the blue evening. Silver mist suffused the deck of the ship. I watched the storm, so beautiful yet terrific. Lorem ipsum dolor sit amet, consectetur adipiscing
      elit. Nulla pellentesque elit justo, nec rutrum leo pulvinar vel.
    </p>

  </div>
  <div>

    <h2>Not Incorrect</h2>
    <p>
      <span aria-hidden="true" class="drop">
        <span>M</span>atthew
      </span>
      <span class="visually-hidden">Matthew</span> watched the storm, so beautiful yet terrific. Mist enveloped the ship three hours out from port. Waves flung themselves at the blue evening. Silver mist suffused the deck of the ship. I watched the storm, so beautiful yet terrific.
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla pellentesque elit justo, nec rutrum leo pulvinar vel.
    </p>

  </div>

  <div>

    <h2>Standard CSS</h2>
    <p>
      Matthew watched the storm, so beautiful yet terrific. Mist enveloped the ship three hours out from port. Waves flung themselves at the blue evening. Silver mist suffused the deck of the ship. I watched the storm, so beautiful yet terrific. Lorem ipsum dolor sit amet, consectetur
      adipiscing elit. Nulla pellentesque elit justo, nec rutrum leo pulvinar vel.
    </p>

  </div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Playfair+Display&display=swap');

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.4;
  color: #333;
  background-color: #eee;
}

body > div {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}

body > div div {
  flex: 0 1 15em;
  margin: 0 1em;
}


/* Styles from another demo */
.dropcap {
  font-family: "Playfair Display", serif;
  font-size: 5.5rem;
  float: left;
  line-height: 1;
  margin-right: 0.05em;
/*   outline: 1px solid #f00; */
}

.dropcap:before,
.dropcap:after {
  content: "";
  display: block;
}
.dropcap:before {
/*   margin-bottom: -0.175em; */
  margin-bottom: -0.21em;
}
.dropcap:after {
  margin-top: -0.05em;
}


/* The revised pattern */
/* Selector to enforce the pattern */
p > span[aria-hidden=true].drop span {
  font-family: "Playfair Display", serif;
  font-size: 5.5rem;
  float: left;
  line-height: 1;
  margin-right: 0.05em;
/*   outline: 1px solid #f00; */
}

p > span[aria-hidden=true].drop span::before,
p > span[aria-hidden=true].drop span::after {
  content: "";
  display: block;
}

p > span[aria-hidden=true].drop span::before {
/*   margin-bottom: -0.175em; */
  margin-bottom: -0.21em;
}

p > span[aria-hidden=true].drop span::after {
  margin-top: -0.05em;
}

.visually-hidden, .hidden {
  position: absolute;
  top: auto;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px;
  height: 1px;
  white-space: nowrap;
}


/* You can use a class; I was just being a brat */
body > div div:last-of-type p:first-letter {
  font-family: "Playfair Display", serif;
  font-size: 5.5rem;
  float: left;
  line-height: .6; /* from 1 */
  margin-right: 0.05em;
}
              
            
!

JS

              
                
              
            
!
999px

Console