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.
<section id="timeline">
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/d/header_wieland_ny-1cdf09e4.jpg
)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2009</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Vestibulum laoreet lorem</h1>
<p>Suspendisse potenti. Sed sollicitudin eros lorem, eget accumsan risus dictum id. Maecenas dignissim ipsum vel mi rutrum egestas. Donec mauris nibh, facilisis ut hendrerit vel, fringilla sed felis. Morbi sed nisl et arcu.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/6/kachel_careers_spot-eeeb207b.jpg)">
</div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2010</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Phasellus mauris elit</h1>
<p>Mauris cursus magna at libero lobortis tempor. Suspendisse potenti. Aliquam interdum vulputate neque sit amet varius. Maecenas ac pulvinar nisi. Fusce vitae nunc ultrices, tristique dolor at, porttitor dolor. Etiam id cursus arcu, in dapibus nibh. Pellentesque non porta leo. Nulla eros odio, egestas quis efficitur vel, pretium sed.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/2/home_slider_empowering_success_thenewbrandpage-c8c3fca2.jpg
)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2011</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Mauris vitae nunc elem</h1>
<p>Suspendisse ac mi at dolor sodales faucibus. Nunc sagittis ornare purus non euismod. Donec vestibulum efficitur tortor, eget efficitur enim facilisis consequat. Vivamus laoreet laoreet elit. Ut ut varius metus, bibendum imperdiet ex. Curabitur diam quam, blandit at risus nec, pulvinar porttitor lorem. Pellentesque dolor elit.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/9/responsibility_3-54e5a756.jpg
)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2012</p>
</div>
<div class="tl-content">
<h1>Lorem ipsum dolor sit</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/3/strips_sheets_coilsdrums-b0b72ee3.png)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2013</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Vestibulum laoreet lorem</h1>
<p>Suspendisse potenti. Sed sollicitudin eros lorem, eget accumsan risus dictum id. Maecenas dignissim ipsum vel mi rutrum egestas. Donec mauris nibh, facilisis ut hendrerit vel, fringilla sed felis. Morbi sed nisl et arcu.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/b/header_wieland_eMobility_1-f1ea109f.jpg)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2014</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Phasellus mauris elit</h1>
<p>Mauris cursus magna at libero lobortis tempor. Suspendisse potenti. Aliquam interdum vulputate neque sit amet varius. Maecenas ac pulvinar nisi. Fusce vitae nunc ultrices, tristique dolor at, porttitor dolor. Etiam id cursus arcu, in dapibus nibh. Pellentesque non porta leo. Nulla eros odio, egestas quis efficitur vel, pretium sed.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/6/kachel_careers_spot-eeeb207b.jpg)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2015</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Mauris vitae nunc elem</h1>
<p>Suspendisse ac mi at dolor sodales faucibus. Nunc sagittis ornare purus non euismod. Donec vestibulum efficitur tortor, eget efficitur enim facilisis consequat. Vivamus laoreet laoreet elit. Ut ut varius metus, bibendum imperdiet ex. Curabitur diam quam, blandit at risus nec, pulvinar porttitor lorem. Pellentesque dolor elit.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/3/strips_sheets_coilsdrums-b0b72ee3.png)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2016</p>
</div>
<div class="tl-content">
<h1>Lorem ipsum dolor sit</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/2/home_slider_empowering_success_thenewbrandpage-c8c3fca2.jpg)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2017</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Vestibulum laoreet lorem</h1>
<p>Suspendisse potenti. Sed sollicitudin eros lorem, eget accumsan risus dictum id. Maecenas dignissim ipsum vel mi rutrum egestas. Donec mauris nibh, facilisis ut hendrerit vel, fringilla sed felis. Morbi sed nisl et arcu.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/b/header_wieland_eMobility_1-f1ea109f.jpg)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2018</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Phasellus mauris elit</h1>
<p>Mauris cursus magna at libero lobortis tempor. Suspendisse potenti. Aliquam interdum vulputate neque sit amet varius. Maecenas ac pulvinar nisi. Fusce vitae nunc ultrices, tristique dolor at, porttitor dolor. Etiam id cursus arcu, in dapibus nibh. Pellentesque non porta leo. Nulla eros odio, egestas quis efficitur vel, pretium sed.</p>
</div>
</div>
<div class="tl-item">
<div class="tl-bg" style="background-image: url(https://www.wieland.com/assets/images/d/header_wieland_ny-1cdf09e4.jpg)"></div>
<div class="tl-year">
<p class="f2 heading--sanSerif">2019</p>
</div>
<div class="tl-content">
<h1 class="f3 text--accent ttu">Mauris vitae nunc elem</h1>
<p>Suspendisse ac mi at dolor sodales faucibus. Nunc sagittis ornare purus non euismod. Donec vestibulum efficitur tortor, eget efficitur enim facilisis consequat. Vivamus laoreet laoreet elit. Ut ut varius metus, bibendum imperdiet ex. Curabitur diam quam, blandit at risus nec, pulvinar porttitor lorem. Pellentesque dolor elit.</p>
</div>
</div>
</section>
body {
font-family: "Source Sans Pro", Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 1.75;
}
#timeline {
display: flex;
background-color: #031625;
&:hover {
.tl-item {
width: 23.3333%;
}
}
}
.tl-item {
transform: translate3d(0, 0, 0);
position: relative;
width: 25%;
height: 100vh;
min-height: 600px;
color: #fff;
overflow: hidden;
transition: width 0.5s ease;
&:before,
&:after {
transform: translate3d(0, 0, 0);
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
&:after {
background: transparentize(#e0251b, 0.15);
opacity: 1;
transition: opacity 0.5s ease;
}
&:before {
background: linear-gradient(
to bottom,
rgba(0, 0, 0, 0) 0%,
rgba(0, 0, 0, 1) 75%
);
z-index: 1;
opacity: 0;
transform: translate3d(0, 0, 0) translateY(50%);
transition: opacity 0.5s ease, transform 0.5s ease;
}
&:hover {
width: 30% !important;
&:after {
opacity: 0;
}
&:before {
opacity: 1;
transform: translate3d(0, 0, 0) translateY(0);
transition: opacity 1s ease, transform 1s ease 0.25s;
}
.tl-content {
opacity: 1;
transform: translateY(0);
transition: all 0.75s ease 0.5s;
}
.tl-bg {
filter: grayscale(0);
}
}
}
.tl-content {
transform: translate3d(0, 0, 0) translateY(25px);
position: relative;
z-index: 1;
text-align: center;
margin: 0 1.618em;
top: 55%;
opacity: 0;
h1 {
font-family: "Pathway Gothic One", Helvetica Neue, Helvetica, Arial,
sans-serif;
text-transform: uppercase;
color: #1779cf;
font-size: 1.44rem;
font-weight: normal;
}
}
.tl-year {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
z-index: 1;
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
p {
font-family: "Pathway Gothic One", Helvetica Neue, Helvetica, Arial,
sans-serif;
font-size: 1.728rem;
line-height: 0;
}
}
.tl-bg {
transform: translate3d(0, 0, 0);
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
background-size: cover;
background-position: center center;
transition: filter 0.5s ease;
filter: grayscale(100%);
}
Also see: Tab Triggers