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 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.


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.


                <html amp lang="en">
    <meta charset="utf-8">
    <title>AMP Responsive Layout Demo</title>
    <link rel="canonical" href="/index.html">
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <script type="application/ld+json">
        "@context": "",
        "@type": "NewsArticle",
        "headline": "AMP Responsive Layout Demo",
        "datePublished": "2017-10-12T12:02:41Z",
        "image": [
    <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
    <script async src=""></script>
    <script async custom-element="amp-fit-text" src=""></script>
    <script async custom-element="amp-bind" src=""></script>
    <link href="|Montserrat" rel="stylesheet">
    <style amp-custom>
      body {
        font-family: Montserrat,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Arial,sans-serif;
      div.square {
        width: 200px;
        height: 200px;
        background-color: grey;
        padding: 2px; 
      div.vtphone {
        width: 180px;
        height: 320px;;
      div.desktop {
        width: 426px;
        height: 320px;
    <h1>AMP Responsive Layout Demo</h1>
    <div class="square" [class]="['square', deviceClass].join(' ')">
      <amp-fit-text width="300" height="200" layout="responsive">
        Lorem ipsum dolor sit amet, 
        has nisl nihil convenire et, 
        vim at aeque inermis reprehendunt.
      <p>Adjust Aspect Ratio:</p>
      <p><button on="tap:AMP.setState({deviceClass: 'vtphone'})">Set to Vertical Phone</button></p>
      <p><button on="tap:AMP.setState({deviceClass: 'desktop'})">Set to Desktop</button></p>
      <p><button on="tap:AMP.setState({deviceClass: ''})">Reset Sizing</button></p>
    <hr />
    <div style="font-size:0.8em;">
      <p>No need to thank me!  If you find this demo useful, just consider <a href="" target="_blank">donating $1 dollar</a> for a coffee (secure PayPal link) or purchasing one of my songs from <a href="" target="_blank"></a> or <a href="" target="_blank"></a> for only 0.99 cents each.</p>
      <p>Rob uses and recommends <a href="" target="_blank">MochaHost</a>, which provides Web Hosting for as low as $1.95 per month, as well as unlimited emails and disk space!</p>