Pen Settings



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


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


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.


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.


                <div class="container">
  <h1>Full Screen Demo</h1>
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua...</p>

  <section class="fullscreenEnabled">
    <h2 class="fullscreenintro">More Info Available in Full Screen Mode ...</h2>
    <h2 class="fullscreenMoreInfo">This is the promised full screen mode!</h2>
    <div class="bottomRight">
        aria-label="Click to Toggle Full Screen View of Section"
        class="button buttonBlue"



* {
  box-sizing: border-box;

body {
  font: PT Sans;
  background-color: #000;
  color: #ffefef;

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem;

.fullscreenMoreInfo {
  display: none;

  display: none;

.fullscreenEnabled:fullscreen .fullscreenMoreInfo {
  display: block;

/* Styles for buttons taken from Logrocket article 

CSS Reference Guide: Button styling */

.button {
  padding: 6px 12px;
  margin-bottom: 0;
  font-weight: 400;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
  background-image: none;
  border-radius: 3px;
  box-shadow: none;
  border: 1px solid transparent;

.buttonBlue {
  color: #fff;
  background-color: blue;
  border-color: #2e6da4;    

.fullscreenEnabled {
  display: block;
  position: relative;
  border: 2px solid white;
  padding: 20px 24px;

.bottomRight {
  position: absolute;
  bottom: 10px;
  right: 10px;


                const makeFullScreen = (el) => {
   if (!document.fullscreenElement) {

const  button = document.querySelector("button");

button.addEventListener("click", () => {