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

              
                <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>OSTraining - Create a Column Pattern with Flexbox</title>
    <link rel="stylesheet" href="style.css">
    <link href="https://fonts.googleapis.com/css?family=Playfair+Display|Raleway|Roboto+Condensed|Roboto+Slab:400,700&display=swap" rel="stylesheet">
</head>
<body>
    <div class="header-container">
        <header class="header two-columns">
            <div class="blog-name"><h1>My Blog</h1></div>
            <div class="menu"><ul>
                <li><a href="#">Me</a></li>
                <li><a href="#">You</a></li>
                <li><a href="#">Blog</a></li>
                <li><a href="#">About</a></li>
            </ul></div>
        </header>
    </div>
    <div class="outer-wrapper">
        <div class="container">

<!-- One Column - Image + Text -->
<div class="one-column">
    <img src="http://lorempixel.com/750/465/abstract/1" alt="Example Image">
    <h2>Yet Another Flexbox Blog</h2>
    <p>They're creepy and they're kooky mysterious and spooky. They're all together ooky the Addams Family. All of them had hair of gold like their mother the youngest one in curls.</p>
</div>

<!-- Two Columns - Image + Text -->
<div class="two-columns">
        <img src="http://lorempixel.com/500/310/abstract/2" alt="Example Image">
    <div class="text-container">
        <h3>Lorem ipsum dolor sit amet.</h3>
        <p>The year is 1987 and NASA launches the last of Americas deep space probes. Makin' your way in the world today takes everything you've got. Takin' a break from all your worries sure would help a lot. Today still wanted by the government they survive as soldiers of fortune. The year is 1987 and NASA launches the last of Americas deep space probes.</p>
    </div>
</div>

<!-- Three Columns - Nested Columns -->
<div class="three-columns">
    <img src="http://lorempixel.com/500/310/abstract/3" alt="Example Image">
    <div class="text-container">
        <h3>Lorem ipsum dolor sit amet.</h3>
        <p>Go Speed Racer. Go Speed Racer. Go Speed Racer go! Doin' it our way. Nothin's gonna turn us back now. Straight ahead and on the track now. We're gonna make our dreams come true.</p>
    </div>
    <div class="nested">
        <h3>Lorem ipsum dolor sit.</h3>
        <p>The movie star the professor and Mary Ann here on Gilligans Isle</p>
        <div class="two-columns">
            <img src="http://lorempixel.com/500/310/abstract/4" alt="Example Image">
            <p>In a freak mishap Ranger 3 and its pilot Captain William Buck Rogers are blown out of their trajectory into an orbit which freezes his life support systems and returns Buck Rogers to Earth five-hundred years later.</p>
        </div>
    </div>
</div>

<!-- Four Columns - Card Container -->
<div class="four-columns">
    <div class="card-container">
        <div class="one-column">
            <img src="http://lorempixel.com/250/155/abstract/5" alt="Example Image">
            <h3>Lorem ipsum dolor sit.</h3>
            <p>It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight</p>
            <ul>
                <li>alpha</li>
                <li>beta</li>
                <li>gamma</li>
                <li>delta</li>
            </ul>
        </div>
    </div>
    <div class="card-container">
        <div class="one-column">
            <img src="http://lorempixel.com/250/155/abstract/6" alt="Example Image">
            <h3>Lorem ipsum dolor sit.</h3>
            <p>It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight</p>
            <ul>
                <li>alpha</li>
                <li>beta</li>
                <li>gamma</li>
                <li>delta</li>
            </ul>
        </div>
    </div>
    <div class="card-container">
        <div class="one-column">
            <img src="http://lorempixel.com/250/155/abstract/7" alt="Example Image">
            <h3>Lorem ipsum dolor sit.</h3>
            <p>It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight</p>
            <ul>
                <li>alpha</li>
                <li>beta</li>
                <li>gamma</li>
                <li>delta</li>
            </ul>
        </div>
    </div>
    <div class="card-container">
        <div class="one-column">
            <img src="http://lorempixel.com/250/155/abstract/8" alt="Example Image">
            <h3>Lorem ipsum dolor sit.</h3>
            <p>It's time to put on makeup. It's time to dress up right. It's time to raise the curtain on the Muppet Show tonight</p>
            <ul>
                <li>alpha</li>
                <li>beta</li>
                <li>gamma</li>
                <li>delta</li>
            </ul>
        </div>
    </div>
</div>
        </div>
    </div>
</body>
</html>
              
            
!

CSS

              
                html {
    box-sizing: border-box;
    font-size: 16px; 
}

*, *:before, *:after {
  box-sizing: inherit;
}

body, h1, h2, h3, h4, h5, h6, p, ol, ul {
  margin: 0;
  padding: 0;
  font-family: 'Raleway', sans-serif;
  font-weight: normal;
}

ol, ul {
   list-style: none;
}

.container,   
.one-column,
.two-columns,
.three-columns,
.four-columns {
    display: flex;
    flex-wrap: wrap;
}

.container > * {    /* Target only the direct children of .container */
    margin: 1em 4%; 
}

.one-column > * {   /* Target only the direct children of .one-column */
    flex: 1 0 92%;
}

.two-columns > * {
    flex: 1 0 46%;
}

.three-columns > * {
    flex: 1 0 23%;
}

.four-columns > * {
    flex: 1 0 11.5%;
}

.menu ul {
    display: flex;
    justify-content: space-evenly;
}

.container > img,
.container > * > img,
.container > * > * > img,
.container > * > * > * > img {
    flex-grow: 0;
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

p,
ul,
img {
    padding: 8px 12px;
}

h2,
h3 {
    padding-left: 8px;
}

.outer-wrapper {
    width: 1000px;
    margin: 0 auto;
}

.container {
    width: 90%;
    margin: 0 auto;    
}

/* Header Section */

/* Making the header container stay always on top + border + min-height => this height
 * has to be compensated with margin on top of the next block level element (sibling)
 * ==> .outer-wrapper + shadow  
 **/
.header-container {
    background-color: rgb(236, 236, 236);
    border-bottom: 0.5em double #2e2e2e;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: 100vw;
    min-height: 75px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.outer-wrapper {
    margin-top: 75px;
    z-index: 5;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

/* Align items vertically on the .header section */

.header {
    display: flex;
    align-items: baseline;
    padding-top: 0.5em;
}

.header h1 {
    padding-left: 25%;
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    font-weight: bold; 
}

.header a {
    text-decoration: none;
    font-family: 'Roboto Slab', serif;
    text-transform: uppercase;
    color: #2e2e2e;
}

body,
p,
ol,
ul {
    font-family: 'Raleway', sans-serif;
    color: #1f1f1f;
}

.container h1,
.container h2,
.container h3,
.container h4,
.container h5,
.container h6 {
    font-family: 'Playfair Display', serif;
    text-decoration: underline;
    color: #1d1d1d;    
}
              
            
!

JS

              
                
              
            
!
999px

Console