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

              
                <div class="intro text-center">
  <h1>Stop Smoking Timeline</h1>
</div>
 
<div class="timeline">
  <div class="timeline-item left">
       <div class="head">
        <div class="number-box">
            <span>1</span>
        </div>
        <h2>Hour</h2>
        </div>
    <div class="content">
      <p>In as little as 20 minutes after the last cigarette is smoked, the heart rate drops and returns to normal. Blood pressure begins to drop, and circulation may start to improve.</p>
  
    </div>
  </div>
  <div class="timeline-item  right">
     <div class="head">
        <div class="number-box">
            <span>12</span>
        </div>
        <h2>Hours</h2>
        </div>
    <div class="content">
      <p>After just 12 hours without a cigarette, the body cleanses itself of the excess carbon monoxide from the cigarettes. The carbon monoxide level returns to normal, increasing the body's oxygen levels..</p>
    </div>
  </div>
  <div class="timeline-item  left">
       <div class="head">
        <div class="number-box">
            <span>1</span>
        </div>
        <h2>Day</h2>
        </div>
    <div class="content">
      <p>In as little as 1 day after quitting smoking, a person's blood pressure begins to drop, decreasing the risk of heart disease from smoking-induced high blood pressure. In this short time, a person's oxygen levels will have risen, making physical activity and exercise easier to do, promoting heart-healthy habits.

</p>
    </div>
  </div>
  <div class="timeline-item  right">
       <div class="head">
        <div class="number-box">
            <span>2</span>
        </div>
        <h2>Days</h2>
        </div>
    <div class="content">
      <p>Smoking damages the nerve endings responsible for the senses of smell and taste. In as little as 2 days after quitting, a person may notice a heightened sense of smell and more vivid tastes as these nerves heal.</p>
    </div>
  </div>
  <div class="timeline-item  left">
       <div class="head">
        <div class="number-box">
            <span>3</span>
        </div>
        <h2>Days</h2>
        </div>
    <div class="content">
      <p>3 days after quitting smoking, the nicotine levels in a person's body are depleted. While it is healthier to have no nicotine in the body, this initial depletion can cause nicotine withdrawal. Around 3 days after quitting, most people will experience moodiness and irritability, severe headaches, and cravings as the body readjusts.</p>
    </div>
  </div>
  <div class="timeline-item  right">
       <div class="head">
        <div class="number-box">
            <span>1</span>
        </div>
        <h2>Month</h2>
        </div>
    <div class="content">
      <p>In as little as 1 month, a person's lung function begins to improve. As the lungs heal and lung capacity improves, former smokers may notice less coughing and shortness of breath. Athletic endurance increases and former smokers may notice a renewed ability for cardiovascular activities, such as running and jumping..</p>
    </div>
  </div>
   <div class="timeline-item  left">
       <div class="head">
        <div class="number-box">
            <span>9</span>
        </div>
        <h2>Months</h2>
        </div>
    <div class="content">
      <p>Nine months after quitting, the lungs have significantly healed themselves. The delicate, hair-like structures inside the lungs known as cilia have recovered from the toll cigarette smoke took on them. These structures help push mucus out of the lungs and help fight infections.</p>
    </div>
  </div>
  <div class="timeline-item  right">
       <div class="head">
        <div class="number-box">
            <span>1</span>
        </div>
        <h2>Year</h2>
        </div>
    <div class="content">
      <p>One year after quitting smoking, a person's risk for coronary heart disease decreases by half. This risk will continue to drop past the 1-year mark.</p>
    </div>
  </div>
  <div class="timeline-item  left">
       <div class="head">
        <div class="number-box">
            <span>5</span>
        </div>
        <h2>Years</h2>
        </div>
    <div class="content">
      <p>After 5 years without smoking, the body has healed itself enough for the arteries and blood vessels to begin to widen again. This widening means the blood is less likely to clot, lowering the risk of stroke.</p>
    </div>
  </div>
   <div class="timeline-item  right">
       <div class="head">
        <div class="number-box">
            <span>10</span>
        </div>
        <h2>Years</h2>
        </div>
    <div class="content">
      <p>After 10 years, a person's chances of developing lung cancer and dying from it are roughly cut in half compared with someone who continues to smoke. The likelihood of developing mouth, throat, or pancreatic cancer has significantly reduced.</p>
    </div>
  </div>
  <div class="timeline-item  left">
       <div class="head">
        <div class="number-box">
            <span>15</span>
        </div>
        <h2>Years</h2>
        </div>
    <div class="content">
      <p>After 15 years of having quit smoking, the likelihood of developing coronary heart disease is the equivalent of a non-smoker. Similarly, the risk of developing pancreatic cancer has reduced to the same level as a non-smoker.</p>
    </div>
  </div>
  <div class="timeline-item  right">
       <div class="head">
        <div class="number-box">
            <span>20</span>
        </div>
        <h2>Years</h2>
        </div>
    <div class="content">
      <p>After 20 years, the risk of death from smoking-related causes, including both lung disease and cancer, drops to the level of a person who has never smoked in their life. Also, the risk of developing pancreatic cancer has reduced to that of someone who has never smoked.</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                * {
    box-sizing: border-box;
}

body {
    background-color: #fff;
    font-family: Helvetica, sans-serif;
}

p{
  font-size: 20px;
}

.intro{
  color: #fff;
  padding: 50px;
}

/* The actual timeline (the vertical ruler) */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* The actual timeline (the vertical ruler) */
.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: white;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

/* Container around content */
.timeline-item  {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.head{
    position: relative;
    align-items: left;
    color: #fff;
    font-weight: 400;
    background-color: #007BAA;
    padding: 15px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.head h2{
    line-height: 15px;
    padding: px;
}

.number-box {
    display: inline;
    float: left;
    line-height: 30px;
    font-weight: 600;
    margin-right: 15px;
    background: rgba(0, 0, 0, 0.17);
}

span {
     display: block;
     font-size: 30px;
     padding: 10px;
}

/*The circles on the timeline*/ 
.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -12px;
    background-color: white;
    border: 4px solid #FF9F55;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

/* Place the container to the left */
.left {
    left: 0;
}

/* Place the container to the right */
.right {
    left: 50%;
}

/* Add arrows to the left container (pointing right) */
.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

/* Add arrows to the right container (pointing left) */
.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

/* Fix the circle for containers on the right side */
.right::after {
    left: -12px;
}

/* The actual content */
.content {
    padding: 20px 30px;
    background-color: white;
    position: relative;
    border-radius: 25px;
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
}

/* Media queries - Responsive timeline on screens less than 600px wide */
@media screen and (max-width: 600px) {
  /* Place the timelime to the left */
  .timeline::after {
    left: 31px;
  }
  
  /* Full-width containers */
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  
  /* Make sure that all arrows are pointing leftwards */
  .timeline-item::before {
    left: 60px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
  }

  /* Make sure all circles are at the same spot */
  .left::after, .right::after {
    left: 15px;
  }
  
  /* Make all right containers behave like the left ones */
  .right {
    left: 0%;
  }
}

.img-box img{
  width: 100%;
}
              
            
!

JS

              
                
              
            
!
999px

Console