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

              
                <div id="speech-bubble">
  <p contenteditable>Inspired by the awesome NES.css!<br>With editable text!</p> 
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Press+Start+2P');

body {
  background-color: red;
  padding: 50px;
}

#speech-bubble {
  width: auto;
  max-width: 75%;
  height: auto;
  background-color: #fff;
  padding: 25px;
  display: inline-block;
  margin: 30px 30px 70px;
  position: relative;
  
  box-shadow:
    0 -10px 0 #fff, //top
    0 -20px 0 #000,
    -10px 0 0 #fff, //left
    -20px 0 0 #000,
    0 10px 0 #fff, //bottom
    0 20px 0 #000,
    10px 0 0 #fff, //right
    20px 0 0 #000,
    -10px -10px 0 #000, //top-left corner
    10px 10px 0 #000, //top-right corner
    -10px 10px 0 #000, //bottom-left corner
    10px -10px 0 #000 //bottom-right corner
}

#speech-bubble:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 5%;
  width: 10px;
  height: 10px;
  margin-bottom: -20px;
  background-color: #fff;
  
  box-shadow:
    10px 0 0 #fff,
    20px 0 0 #fff,
    30px 0 0 #fff,
    40px 0 0 #fff,
    50px 0 0 #fff,
    -10px 10px 0 #000,
    0px 10px 0 #fff,
    10px 10px 0 #fff,
    20px 10px 0 #fff,
    30px 10px 0 #fff,
    40px 10px 0 #fff,
    50px 10px 0 #000,
    -30px 20px 0 #000,
    -20px 20px 0 #000,
    -10px 20px 0 #fff,
    0px 20px 0 #fff,
    10px 20px 0 #fff,
    20px 20px 0 #fff,
    30px 20px 0 #000,
    40px 20px 0 #000,
    -40px 30px 0 #000,
    -30px 30px 0 #fff,
    -20px 30px 0 #fff,
    -10px 30px 0 #fff,
    0px 30px 0 #fff,
    10px 30px 0 #000,
    20px 30px 0 #000,
    -40px 40px 0 #000,
    -30px 40px 0 #000,
    -20px 40px 0 #000,
    -10px 40px 0 #000,
    0px 40px 0 #000
}

p {
  min-width: 25px;
  display: inline-block;
  margin: 0;
  font-size: 1.4em;
  font-family: 'Press Start 2P', cursive;
  line-height: 1.5em;
  position: relative;
}

p:empty:before {
  content: 'Inspired by the awesome NES.css';
  color: #555;
  border: 1px solid #ccc;
}

p:empty:focus:before {
  content: '';
  width: 25px;
  height: 1em;
  display: inline-block;
  border: 1px solid #ccc;
  border-bottom: 5px solid #000;
}

p:focus {
  outline: none;
  // caret-color: transparent;
  
  &:after {
    display: none;
  }
}

p:after {
  content: '';
  height: 20px;
  width: 10px;
  margin-top: 5px;
  margin-left: 10px;
  background-color: #000;
  border: 0;
  display: inline-block;
  position: absolute;
  animation: blink 1000ms infinite;
}

@keyframes blink {
  0% {
    background-color: #000;
  }
  49.99999% {
    background-color: #000;
  }
  50% {
    background-color: #fff;
  }
  100% {
    background-color: #fff;
  }
}
              
            
!

JS

              
                // Taking decades of human achievement in web technologies and reverting it all back to the 80's. Playing with box-shadow properties to achieve cool pixelated effect. No real intent to produce anything substantial out of this. Just done for fun.
// Inspired by the awesome NES.css
// https://nostalgic-css.github.io/NES.css/
              
            
!
999px

Console