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.



Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO


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.


Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.


Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO


                <body mv-app="countries" mv-bar="none" mv-source="shapir" mv-source-service="wikidata" mv-init-language="en" mv-source-instance-of="country" mv-source-continent="[continent]" mv-source-numberOfItems="5">
    <h1>Guess the country!</h1>

      <select class="form-select" property="continent">
        <option selected>Europe</option>
      <h2 id="total-score">
        <svg viewBox="0 0 100 100">
          <path d="M 0,50 a 50,50 0 1,1 0,.001" id="textpath"></path>
          <text transform="rotate(-90,50,50)">
            <textPath startOffset="50%" href="#textpath">Total Score</textPath>
    <section id="current">
      <article property="items" mv-multiple class="country status-[status or 'playing'] tries-[tries]" style="--tries: [tries]" mv-if="$index = 0">
        <img property="flag" src="[last(flagImage)]" width="30%">
        <div class="info">
          <form mv-action="set(tries, tries + 1), setif(guess = label, status, 'correct'), setif(guess != label and tries = 3, status, 'wrong')">
            <label class="guess">
              Can you guess which country this is?
              <span class="answer">
                <input property="guess" autofocus>
                <button class="outlined-button check-answer" mv-if="!status">Check answer</button>
                <button class="outlined-button next" mv-if="status" mv-action="move($item, if(status = 'correct', win, loss))">Next</button>
                <button type="button" class="outlined-button give-up" mv-if="!status" mv-action="set(status, 'gaveup'), set(guess, label)">Give up</button>
          <p class="status" mv-if="status or tries > 0" property="statusText">
            [if(status = 'correct', "Yes! Guessed it correctly") ]
            [if(status = 'wrong', "Could not guess it correctly") ]
            [if(status = 'gaveup', "Gave up") ]
            [if(!status, "Nope. Still guessing") ]
            after [tries + 0] tries and [hintsDisplayed + 0] hints

          <meta property="status" />
          <meta property="hintsDisplayed" />
          <meta property="tries" />

          <p class="hint" property="highestPoint" mv-if="hintsDisplayed > 0">
            Its highest Point is <span property="label"></span>.

          <p class="hint" property="lowestPoint" mv-if="hintsDisplayed > 1">
            Its lowest point is <span property="label"></span>.

          <p class="hint" mv-if="hintsDisplayed > 2">
            It’s a <span property="description"></span>.

          <p class="hint" property="capital" mv-if="hintsDisplayed > 3">
            Its capital is <span property="label"></span>.

          <div class="score" property="score">[if (status = 'correct', 20 - hintsDisplayed - (tries - 1) * 3)]</div>

            <button class="show-hint" mv-action="set(hintsDisplayed, hintsDisplayed + 1)" mv-if="!status and hintsDisplayed < 4">Show hint</button>
            <a class="read-more" href="[itemURL]" target="_blank" mv-if="status">Read more about [label] on Wikidata</a>
    <section id="results">
      <details id="correct-guesses" open>
        <summary>Guessed [count(win)] countries correctly</summary>
        <article property="win" mv-multiple class="country status-[status]" mv-initial-items="0">
          <img property="flag">
          <div class="info">
            <h3 property="label"></h3>
            <p class="status" mv-if="status" property="statusText"></p>
            <div class="score" property="score"></div>
      <details id="wrong-guesses" open>
        <summary>Could not guess [count(loss)] countries </summary>
        <article property="loss" mv-multiple class="country status-[status]" mv-initial-items="0">
          <img property="flag">
          <div class="info">
            <h3 property="label"></h3>
            <p class="status" mv-if="status" property="statusText"></p>
            <div class="score" property="score"></div>




What's a functional programmer's favorite animal? A lamb, duh!