Pen Settings

HTML

CSS

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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;700&display=swap" rel="stylesheet">
</head>
<body>
    <div class="timeline">
        <div class="container container-left">
            <div class="image" style="background-image:url('https://images.pexels.com/photos/307008/pexels-photo-307008.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=100')"></div>
            <div class="content">
                <span>July 2020</span>
                <h2>Visit to Spain</h2>
                <p>
                    Et hinc magna voluptatum usu, cum veniam graece et. Ius ea scripserit temporibus, pri cu harum tacimates neglegentur. At adipisci incorrupte nam. Cu qui sumo appareat constituto.
                </p>
            </div>
        </div>
        <div class="container container-right">
            <div class="image" style="background-image:url('https://images.pexels.com/photos/210012/pexels-photo-210012.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=100')"></div>
            <div class="content">
                <span>March 2019</span>
                <h2>High up in the sky</h2>
                <p>
                    Habemus principes eos id, eu sonet patrioque nam. Eu his mazim insolens, et vim saperet laboramus. Enim gubergren temporibus vix ei. Dicunt iuvaret sadipscing te nam, legere assueverit sed in, at everti labores.
                </p>
            </div>
        </div>
        <div class="container container-left">
            <div class="image" style="background-image:url('https://images.pexels.com/photos/2104152/pexels-photo-2104152.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=100')"></div>
            <div class="content">
                <span>June 2018</span>
                <h2>First solo trip</h2>
                <p>
                    Scaevola definitiones eum et. Assum postulant periculis per ei. Doming scribentur sea an. Eum verear docendi tincidunt in.
                </p>
            </div>
        </div>
    </div>
</body>
</html>
              
            
!

CSS

              
                * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: #EDF2F7;
    font-family: 'Noto Sans', sans-serif;
    font-size: 1em;
    color: #4A5568;
}
.timeline {
    position: relative;
    max-width: 1200px; /* Restrict the width on large screens */
    margin: 0 auto; /* Center the content */
    padding: 30px;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: white;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1;
}
.container {
    position: relative;
    width: 50%;
    min-height: 120px;
}
.container-left {
    left: 0;
    padding-right: 70px;
    text-align: right;
}
.container-right {
    left: 50%;
    padding-left: 70px;
    text-align: left;
}
.content {
    padding: 30px;
    background-color: white;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.container .content::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 35px;
    width: 0;
    z-index: 1;
    border: medium solid white;
}
.container-left .content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}
.container-right .content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}
.image {
    position: absolute;
    width: 90px;
    height: 90px;
    background-size: cover;
    background-position: center;
    border: solid 5px #ffffff;
    border-radius: 50px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 2;
}
.container-left .image {
    right: 0;
    margin-right: -45px;
}
.container-right .image {
    left: 0;
    margin-left: -45px;
}
.content span {
    color: #2C7A7B;
    font-size: 1.1em;
    font-weight: bold;
}
.content h2 {
    font-size: 1.8em;
    padding-top: 5px;
}
.content p {
    line-height: 1.6;
    padding-top: 5px;
}
@media screen and (max-width: 767px) {
    .timeline::after {
        left: 65px;
    }
    .container {
        width: 100%;
        padding-left: 100px;
        padding-right: 0px;
        margin-top: 30px;
    }
    .container:first-of-type {
        margin-top: 0px;
    }
    .container-right {
        left: 0%;
    }
    .container-left {
        text-align: left;
    }
    .container .image {
        left:-10px;
        top: 0px;
        margin-left: 0;
        margin-right: 0;
    }
    .container-left .content::before {
        left: -10px;
        right: auto;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }
}
@media screen and (max-width: 480px) {
    .container {
        padding-left: 0px;
        padding-top: 105px;
        z-index: 3;
    }
    .container .content::before {
        left: 25px;
        top: -10px;
        border: medium solid white;
        border-width: 0 10px 10px 10px;
        border-color: transparent transparent white transparent;
    }
}
              
            
!

JS

              
                
              
            
!
999px

Console