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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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="article">
<div class="wrapper">
<div class="wrapperText">
<h1>
<mark>Tattooed helvetica celiac leggings waistcoat vegan retro selfies</mark>
</h1>
<p id="author">
<mark>by Lina Regental</mark>
</p>
<div id="accountDetail" class="accountInfo">
<div class="header">
<h2><mark>Lina Regental</mark></h2>
<p><mark>Producer & Author</mark></p>
</div>
<div class="profilePicture"></div>
<p class="profileText">Chef, Community Volunteer, Conveyor of Messages, Electro Producer, Scapegoat. Is that a double rainbow? D:.</p>
<button>Check me out ></button>
</div>
</div>
</div>
<!--The Text is generated with hipsum.co :) Check it out! -->
<div class="articleText">
<h4 class="introduction">Three wolf moon post-ironic bespoke lomo tattooed kinfolk. Retro typewriter gluten-free hashtag cold-pressed. Beard cliche echo park banh mi. Tattooed helvetica celiac, leggings waistcoat vegan retro selfies art party distillery mustache echo park.</h4>
<p>Beard cliche echo park banh mi. Salvia tousled sustainable fap, poutine direct trade scenester. Vinyl gastropub put a bird on it, skateboard YOLO ethical flannel flexitarian kale chips. 3 wolf moon post-ironic bespoke lomo tattooed kinfolk. Retro typewriter gluten-free hashtag cold-pressed. Meh paleo aesthetic, chia mlkshk etsy pickled ethical. Tattooed helvetica celiac, leggings waistcoat vegan retro selfies art party distillery mustache echo park.</p>
<h2>Kale chips</h2>
<p>Occupy gluten-free umami wayfarers, post-ironic normcore semiotics listicle deep v health goth cold-pressed. Raw denim williamsburg synth normcore actually. Health goth post-ironic whatever, flannel mlkshk tacos thundercats seitan put a bird on it try-hard migas small batch. Occupy small batch intelligentsia, food truck gochujang viral iPhone letterpress chicharrones etsy flannel. Banjo +1 slow-carb venmo hashtag health goth. Tumblr DIY occupy try-hard. Quinoa scenester disrupt brooklyn mixtape, banh mi hoodie beard messenger bag locavore kale chips.</p>
<p>Pop-up echo park semiotics williamsburg, next level literally retro neutra. Microdosing twee lo-fi squid actually art party, intelligentsia sartorial try-hard tote bag irony. Cliche mlkshk freegan, truffaut master cleanse bushwick offal distillery chicharrones man bun occupy thundercats vice pork belly yr. Small batch mixtape helvetica +1. Godard ethical tote bag 8-bit fixie, raw denim pitchfork. Fap venmo four loko lo-fi chicharrones, small batch umami retro intelligentsia irony pug man braid flannel migas. Gentrify taxidermy bicycle rights sustainable, chia tattooed meggings chicharrones literally actually gochujang fanny pack.</p>
<h2>Helvetica cray</h2>
<p>Locavore YOLO asymmetrical polaroid, aesthetic bitters mumblecore gochujang master cleanse cray helvetica kogi. Put a bird on it helvetica food truck pop-up etsy, echo park forage organic readymade trust fund. Post-ironic try-hard echo park, selfies wolf selvage synth squid single-origin coffee raw denim tacos twee hella. Art party meggings pug shoreditch waistcoat. Post-ironic hammock quinoa, pickled pop-up cardigan cred put a bird on it banh mi green juice cliche paleo. 90's cray fingerstache, irony chia slow-carb butcher deep v direct trade YOLO. Helvetica cray vegan freegan four loko put a bird on it, gentrify etsy locavore wayfarers pickled aesthetic tousled.</p>
</div>
</div>
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,300,700);
*{
/* I know I could write "margin: 0; padding: 0;". But that's not performant. */
font-family: 'Open Sans';
line-height: 170%;
color: #444;
}
body, p, h1, h2{
margin: 0;
padding: 0;
}
h2{
margin-top: 20px;
}
mark {
background-color: white;
padding: 0px 3px;
}
.wrapper{
padding: 100px;
margin: 0 0 50px 0;
text-align: left;
height: 40vh;
background: url('https://source.unsplash.com/KqVHRmHVwwM/1600x900') no-repeat center center fixed;
background-size: cover;
transition: all 0.4s ease;
}
.articleText{
margin: 0 10% 30px 20%;
width: 60%;
max-width: 800px;
padding-left: 30px;
border-left: 1px solid #cccccc;
transition: all 0.4s ease;
}
.introduction{
margin-bottom: 20px;
}
.accountInfo{
transition: all ease 0.5s;
display: none;
height: 420px;
width: 250px;
background: white;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.accountInfo .header{
background: url('https://source.unsplash.com/V6s1cmE39XM/250x250') no-repeat;
height: 120px;
width: 100%;
padding: 20px 10px;
}
.accountInfo .profilePicture{
z-index: 1;
margin: -25px auto 10px auto;
background: url('https://source.unsplash.com/LyeduBb2Auk/100x100') no-repeat;
height: 100px;
width: 100px;
border-radius: 5px;
}
.accountInfo .profileText{
text-align: center;
margin-bottom: 20px;
}
button{
font-size: 16px;
width: 100%;
background: white;
border: 0;
padding: 12px 0px;
transition: all ease 0.5s;
cursor: pointer;
}
button:hover{
box-shadow: inset 400px 0 0 0 #444;
color: white;
}
@media only screen and (max-width: 1000px) {
/* For tablets: */
.articleText {
margin: 0 10% 30px 10%;
width: 80%;
max-width: 800px;
padding-left: 0px;
border: 0;
}
}
@media only screen and (max-width: 768px) {
/* For mobile phones: */
.articleText {
margin: 0 5% 30px 5%;
width: 90%;
}
.wrapper{
padding: 5%;
}
}
//$('#author').hover(
// function() {
// var accountDetail = $('#accountDetail');
// accountDetail.fadeIn();
// accountDetail.css('position', "absolute");
// accountDetail.css('top', $(this).position.top);
// accountDetail.css('left', $(this).position.left)
// }
//);
//$(document).mouseup(function (e)
//{
// var accountDetail = $('#accountDetail');
//
// if (!accountDetail.is(e.target) && accountDetail.has(e.target).length === 0)
// {
// accountDetail.fadeOut();
// }
//});
Also see: Tab Triggers