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

              
                <header class="site-header">
  <img src="https://dbwebb.se/img/htmlphp/guide/murphy/murphy-logo.jpg" alt="logo">
  <span class="site-title">Stormtrooper-Murphy</span>
  <span class="site-slogan">Deathstar's finest.</span>
</header>
<nav class="navbar">
  <a href="index.html" class="selected">Home</a>
  <a href="about.html">About</a>
</nav>
<main>
  <article>
    <header>
      <h1>This is a Stormtrooper</h1>
      <p class="author">Updated <time datetime="2018-06-25 11:17:43">25th June 2018</time> by Murphy</p>
    </header>
    <img src="https://dbwebb.se/img/htmlphp/guide/murphy/murphy-me.jpg" alt="This is me!" class="me">
    <p>
      Stormtroopers get a bad rap – the army of the Dark Lord of the Sith in the original Star Wars films is probably best known for its lack of aim, even at close range. Stormtroopers were tricked, manipulated, out-maneuvered, shot at, and defeated repeatedly by the heroes of the franchise.
    </p>
    <p>
      Contrary to what many fans believed after the prequel trilogy, stormtroopers are not clone troopers. The clone soldiers that were created on Kamino aged more quickly than other humans and died prematurely, and so, the clone troopers had been replaced by Imperial stormtroopers, who were recruited and trained at Imperial Academies.
    </p>
    <p>
      The name "stormtrooper" comes from the German "Stoßtruppe", which was the name given to shock troopers in World War I and World War II. The stormtroopers were the men on the front lines, trying to infiltrate enemy trenches. They had high casualties, because they were at the center of the action, putting their lives in harm’s way.
    </p>
    <footer class="byline">
      <img class="byline-me" src="https://dbwebb.se/img/htmlphp/guide/murphy/murphy-byline.jpg" alt="byline image of me!">
      <p>
        Stormtrooper-Murphy worked at the "Deathstar" during the weeks. It was a pretty unappreciated work with close to no freetime. When Murphy has a couple of minutes over, the fine art of square-dance is practiced to perfection with the fellow troopers. Murphy is the 5679th best shooter in the squad and a life-long dream is to see Disney World sometime, someday...
      </p>
    </footer>
  </article>
</main>


<footer class="site-footer">
  <hr>
  <a href="http://validator.w3.org/check/referer">HTML5</a>
  <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
  <a href="http://validator.w3.org/unicorn/check?ucn_uri=referer&amp;ucn_task=conformance">Unicorn</a>
</footer>

              
            
!

CSS

              
                html {
	background-image: url("https://dbwebb.se/img/htmlphp/guide/murphy/background.jpg");
    background-attachment: fixed;
    background-position: bottom right;
    background-color: black;
    background-repeat: no-repeat;
    overflow-y: scroll;
}

body {
    background-color: #ddd;
    width: 1000px;
    margin: 8px auto;
    border: 1px solid black;
}

.site-header {
    background-color: #292a2e;
    color: white;
    overflow: auto;
}

.site-header img {
    float: left;
}

.site-title {
    display: block;
    padding-top: 1em;
    padding-left: 50px;
    font-size: 46px;
    overflow: auto;
}

.site-slogan {
    display: block;
    padding-left: 50px;
    font-style: italic;
    font-size: 28px;
    overflow: auto;
}

.site-footer {
    height: 70px;
    margin-top: 10px;
}

.me {
    width: 450px;
    margin-right: 20px;
    float: left;
}

.navbar {
    padding: 1em;
    background-color: #fff;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
}

.navbar a {
    background-color: #eee;
    display: inline-block;
    padding: 0.5em 1em;
    border: 1px solid #999;
    text-decoration: none;
    color: #000;
}

.navbar a:hover {
    background-color: #000;
    color: #fff;
}

.navbar .selected {
    background-color: #000;
    color: #fff;
}

.byline {
    padding: 5px;
    border-top: 1px solid black;
    overflow: auto;
}

.byline img {
    float: left;
    margin-right: 30px;
}

.byline p {
    margin-top: 0;
}

article {
    padding: 10px;
}

article > header {
    text-align: center;
}

main {
    min-height: 30em;
}

.author {
    font-size: 15px;
    font-style: italic;
}

.center {
    text-align: center;
}

@media (max-width: 980px) {
    body {
        width: auto;
        background-color: black;
    }

    .byline {
        font-size: 10px;
    }

    .author {
        font-size: 10px;
        color: #aaa;
    }

    .me {
        width: 80%;
        display: block;
        margin-bottom: 20px;
    }

    main {
        background-color: #000;
        margin-top: 15px;
        color: white;
        display: block;
        border: 1px solid black;
    }


    .navbar a {
        width: 90%;
        text-align: left;
        font-size: 18px;
        background-color: #666;
        display: block;
        border: 1px solid #eee;
        text-decoration: none;
        color: white;
    }

    .site-title,
    .site-slogan {
        display: none;
    }

    .main-logo,
    .site-header {
        width: auto;
    }
}

              
            
!

JS

              
                
              
            
!
999px

Console