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

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

              
                    <div class="timeline">
        <ul>
            <li>
                <div class="noi_dung">
                    <h3>Thông Tin Timeline 1</h3>
                    <p>
                        Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi, illo ipsum accusamus mollitia
                        et, ipsam vel eaque at quisquam magnam incidunt amet consectetur praesentium aperiam,
                        reprehenderit quaerat iste nam porro.
                    </p>
                </div>
                <div class="thoi_gian">
                    <h4>
                        Tháng 1 Năm 2020
                    </h4>
                </div>
            </li>
            <li>
            <div class="noi_dung">
                <h3>Thông Tin Timeline 2</h3>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi, illo ipsum accusamus mollitia et,
                    ipsam vel eaque at quisquam magnam incidunt amet consectetur praesentium aperiam, reprehenderit
                    quaerat iste nam porro.
                </p>
            </div>
            <div class="thoi_gian">
                <h4>
                    Tháng 2 Năm 2020
                </h4>
            </div>
            </li>
            <li>
            <div class="noi_dung">
                <h3>Thông Tin Timeline 3</h3>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi, illo ipsum accusamus mollitia et,
                    ipsam vel eaque at quisquam magnam incidunt amet consectetur praesentium aperiam, reprehenderit
                    quaerat iste nam porro.
                </p>
            </div>
            <div class="thoi_gian">
                <h4>
                    Tháng 3 Năm 2020
                </h4>
            </div>
            </li>
            <li>
            <div class="noi_dung">
                <h3>Thông Tin Timeline 4</h3>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi, illo ipsum accusamus mollitia et,
                    ipsam vel eaque at quisquam magnam incidunt amet consectetur praesentium aperiam, reprehenderit
                    quaerat iste nam porro.
                </p>
            </div>
            <div class="thoi_gian">
                <h4>
                    Tháng 4 Năm 2020
                </h4>
            </div>
            </li>
            <li>
            <div class="noi_dung">
                <h3>Thông Tin Timeline 5</h3>
                <p>
                    Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi, illo ipsum accusamus mollitia et,
                    ipsam vel eaque at quisquam magnam incidunt amet consectetur praesentium aperiam, reprehenderit
                    quaerat iste nam porro.
                </p>
            </div>
            <div class="thoi_gian">
                <h4>
                    Tháng 5 Năm 2020
                </h4>
            </div>
            </li>
            <div style="clear:both"></div>
        </ul>
    </div>
              
            
!

CSS

              
                body{
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
}

.timeline{
    position: relative;
    margin: 50px auto;
    padding: 40px 0;
    width: 1000px;
    box-sizing: border-box;
}



.timeline ul {
    margin: 0;
    padding: 0;
}

.timeline ul li{
    line-height: normal;
    position: relative;
    width: 50%;
    padding: 20px 40px;
    box-sizing: border-box;
    list-style: none;
}
.timeline:before{
    content: '';
    position: absolute;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #c5c5c5;
}


.timeline ul li:nth-child(odd){
    float: left;
    text-align: right;
    clear: both;
}

.timeline ul li:nth-child(even){
    float: right;
    text-align: left;
    clear: both;
}

.noi_dung{
    padding-bottom: 20px;
}



.timeline ul li:nth-child(odd):before{
    content: '';
    position: absolute;
    top: 24px;
    right: -6px;
    width: 10px;
    height: 10px;
    background: rgba(97, 123, 227, 1);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(97, 123, 227, 0.2);
}

.timeline ul li:nth-child(even):before{
    content: '';
    position: absolute;
    top: 24px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: rgba(97, 123, 227, 1);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(97, 123, 227, 0.2);
}

.timeline ul li h3{
    margin: 0;
    padding: 0;
    font-weight: 500;
    color: rgba(97, 123, 227, 1);
}

.timeline ul li p{
    margin: 10px 0 0;
    padding: 0;
}
.timeline ul li .thoi_gian h4{
    margin: 0;
    padding: 0;
    font-size: 14px;
}
.timeline ul li:nth-child(odd) .thoi_gian{
    position: absolute;
    top: 12px;
    right: -165px;
    margin: 0;
    padding: 8px 16px;
    background: rgba(97, 123, 227, 1);
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 0 0 3px rgba(97, 123, 227, 0.4);
}

.timeline ul li:nth-child(even) .thoi_gian{
    position: absolute;
    top: 12px;
    left: -165px;
    margin: 0;
    padding: 8px 16px;
    background: rgba(97, 123, 227, 1);
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 0 0 3px rgba(97, 123, 227, 0.4);
}

              
            
!

JS

              
                
              
            
!
999px

Console