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

              
                <main>
    <h1>Font Face CSS - How to Use Google Fonts</h1>
    <p class="intro">
        You can easily make your site look much better by applying some custom fonts. You have a few options how to do it
        and in this example two of them will be presented - downloading font and hosting it yourself, or using Google Fonts API.
    </p>
    <section>
        <article class="downloaded">
            <h2>How to Use Downloaded Fonts in CSS</h2>
            <p>Chocolate danish marshmallow brownie oat cake. Bonbon cookie bear claw tootsie roll cupcake. Lollipop jelly-o lollipop liquorice jelly-o cookie cotton candy macaroon. Gingerbread gingerbread cupcake sweet ice cream cheesecake. Powder macaroon brownie soufflé chocolate bar. Jujubes sweet halvah muffin dessert. Topping pie cake cookie soufflé gummi bears. Chocolate cake bonbon macaroon donut lemon drops marshmallow toffee fruitcake.</p>
        </article>

        <article class="google">
            <h2>How to Use Google Fonts in CSS</h2>
            <p>Candy biscuit sweet toffee pastry. Candy cake cookie bonbon marshmallow gingerbread powder sweet roll candy canes. Chocolate cake candy canes danish gummies wafer halvah muffin. Brownie jelly beans fruitcake tiramisu apple pie oat cake candy canes chocolate bar. Croissant muffin powder bear claw tiramisu. Jelly-o tiramisu tootsie roll bear claw cake cheesecake cupcake chocolate bar lollipop.</p>
        </article>
    </section>

    <footer>
        Get more ideas at <a href="https://ideaspot.tv" target="_blank">ideaspot.tv!</a>
    </footer>
</main>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'Londrina Solid'; src: local('Londrina Solid'), url("fonts/Londrina_Solid/LondrinaSolid-Thin.ttf");
  font-style: normal;
  font-weight: 100;
}

@font-face {
  font-family: 'Londrina Solid'; src: local('Londrina Solid'), url("fonts/Londrina_Solid/LondrinaSolid-Light.ttf");
  font-style: normal;
  font-weight: 300;
}

@font-face {
  font-family: 'Londrina Solid'; src: local('Londrina Solid'), url("fonts/Londrina_Solid/LondrinaSolid-Regular.ttf");
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: 'Londrina Solid'; src: local('Londrina Solid'), url("fonts/Londrina_Solid/LondrinaSolid-Black.ttf");
  font-style: normal;
  font-weight: 700;
}

* {
  box-sizing: border-box;
}

body {
  margin: 3em;
  font-family: 'Open Sans', sans-serif;
}

h1, h2 {
  text-align: center;
}

h1 {
  font-weight: 900;
}

main {
  max-width: 70rem;
  margin: 0 auto;
}

section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

article {
  padding: 1rem;
  margin: 1rem 2rem;
  width: 30rem;
  box-shadow: 0 0 20px black;
  border-radius: 5px;

  p {
    text-align: justify;
  }

  &.downloaded {
    font-family: 'Londrina Solid', cursive;
    font-weight: 300;
  }

  &.google {
    font-family: 'Caveat', cursive;
    font-weight: 400;
  }
}

footer {
  width: 80vw;
  max-width: 1280px;
  margin: 1em auto;
  text-align: center;
}

              
            
!

JS

              
                
              
            
!
999px

Console