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.


                <html lang="en-us">
      <a href="#" class="nav-item i18n-home"></a>
      <a href="#" class="nav-item i18n-projects"></a>
      <a href="#" class="nav-item i18n-contact"></a>
    <div class="main">
      <h1 class="i18n-title"></h1>
      <p class="i18n-intro"></p>
      <button type="button" class="lang-switcher i18n-switch-lang"></button>


                nav {
  border-bottom: 1px solid black;
  margin-bottom: 20px;

.nav-item {
  display: inline-block;
  padding: 5px;
  background: #fcc;
  text-decoration: none;
  color: black;

.main {
  background: #eee;
  padding: 10px;

button {
  font-size: 1.4em;
  font-weight: bold;

.i18n-home:before {
  content: "Home";
  [lang="de-de"] & {
    content: "Start";

.i18n-projects:before {
  content: "Projects";
  [lang="de-de"] & {
    content: "Projekte";

.i18n-contact:before {
  content: "Contact";
  [lang="de-de"] & {
    content: "Kontakt";

.i18n-intro:before {
  content: "Everyone knows about the separation of content and presentation. But how about separating content from markup? All text on this page is stored in CSS, which enables us to change the language of everything by simply changing the lang attribute of the html element. I know this is a bad idea, but a cool one.";
  [lang="de-de"] & {
    content: "Jeder weiß, dass man Inhalt und Darstellung trennen soll. Aber wer sagt, dass man nicht stattdessen Inhalt von Markup trennen kann? Alle Texte auf dieser Seite liegen im CSS, wodurch wir die Sprache sofort ändern können, in dem wir einfach das lang-Attribut des html-Elements ändern. Ich weiß sehr wohl, dass das eine schlechte Idee ist, aber cool ist sie auf jeden Fall.";

.i18n-title:before {
  content: "CSS-based Internationalization";
  [lang="de-de"] & {
    content: "CSS-basierte Internationalisierung";

.i18n-switch-lang:before {
  content: "Switch language";
  [lang="de-de"] & {
    content: "Sprache ändern";


                $(".lang-switcher").on("click", function() {
  var $html = $("html");
  if ($html.attr("lang") === "de-de") {
    $html.attr("lang", "en-us");
  } else {
    $html.attr("lang", "de-de");