cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="container">

There is text below, but all you should see is a black 16x16 square created using the :after pseudo element.

<div class="item hide-text">This text is hidden, but I can still show things like background and pseudo elements.</div>

<div class="border">
  <div class="item">You should be able to see this text, but there should be blank space below because the next line is visually hidden...</div>
  <div class="item visually-hidden">Hide only visually, but have it available for screen readers.</div>
</div>
  
</div>
            
          
!
            
              @mixin hide($accessible: false) {

  @if $accessible != true {
    color: transparent;
    font: 0/0 a;
    text-shadow: none;
  } 
  @else {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;

    &.focusable:active,
    &.focusable:focus {
      clip: auto;
      height: auto;
      margin: 0;
      overflow: visible;
      position: static;
      width: auto;
    }
  }
}

.container {
  width: 50%;
  padding: 30px;
  margin: 20px auto;
}

.hide-accessible {
   @include hide(true);
}

.hide-all {
   @include hide();
}

.item {
  margin-bottom: 20px;
}

.border {
  border: 1px solid #000;
}

.hide-text {
  @include hide();
  height: 16px;
  &:after {
     content: " ";
     display: block;
     height: 16px;
     width: 16px;
     background-color: black;
  }
}

.visually-hidden {
  @include hide(true);
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console