HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<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>
* {
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%;
}
Also see: Tab Triggers