Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


Save Automatically?

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.



1) Fork this Pen to your own CodePen account (click the 'Fork' button located in the upper right of this Pen).

2) The markup below has been styled using both inline and internal CSS. As we've learned, this isn't best practice, so let's refactor our CSS styles! Refactoring simply means re-structuring parts of our code without changing its functionality or output. Keep the following things in mind as you begin to refactor your CSS styles:
 - Internal CSS = styles written between <style></style> tags.
 - Inline CSS = styles applied directly to an element via the style="" attribute.
 - Pay close attention to any class or id attributes used in the markup. These should remain in place as you refactor, and should be used in your external CSS to reduce repetition in your stylesheet.
 - You should not be adding any attributes to the markup (class, id, etc.).

*NOTE: For this exercise, you don't need to include a <link> element in the <head> section of your HTML to reference your external CSS stylesheet. In CodePen, any styles that we write in the CSS panel to the right will be applied to our markup automatically - thanks again CodePen 🙌

3) When you're done refactoring your inline CSS to an external stylesheet, the output in the preview panel should look the same as when you started.


  body {
    width: 50%;
    margin: 2rem auto;
    font-family: 'Open Sans', sans-serif;

  p {
    font-size: 1rem;
  h1, h2 {
    margin-bottom: 5px;

<h1 class="heading" style="font-size: 3rem; font-family: 'Noto Serif', serif;">Please Do Learn to Code</h1>
<p id="source" style="font-style: italic;">Excerpted from <a href="" style="font-weight: bold; color: #2a8764;">Medium Post</a> by Quincy Larson</p>

<p>This morning I woke up to dozens of messages from students who had read an article titled “Please Don’t Learn to Code.”</p>

<p>At first, I assumed <a href="" style="font-weight: bold; color: #2a8764;">Jeff Atwood’s 2012 article</a> had spontaneously reappeared on Reddit. But no — this was a brand new Tech Crunch article of the same name, which echoed Atwood’s assertion that encouraging everyone to learn programming is like encouraging everyone to learn plumbing.</p>

<p>Here’s why programming — unlike plumbing — is an important skill that everyone should learn:</p> 
<p class="special" style="color: #b03060; font-weight: bold; font-size: 1.25rem">Programming is How Humans Talk to Machines</p>

<h2 class="heading" style="font-size: 2rem; font-family: 'Noto Serif', serif;">Coding isn’t some niche skill. It really is “the new literacy.”</h2>

<p>It’s the essential 21st century skill that every ambitious person needs to learn if they want to succeed.</p>

<p>Don’t believe me? Just look at the legal profession. Software is turning it inside out, and causing mass unemployment for the lawyers who can’t code.</p>

<p>The same is increasingly true for managers, marketers, accountants, doctors, and pretty much every white-collar job in between.</p>

<p class="special" style="color: #b03060; font-weight: bold; font-size: 1.25rem">Learn to code. Learn to talk to machines. And flourish.</p>


                /* Write your external CSS styles here */