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.
<link href="https://fonts.googleapis.com/css?family=Satisfy" rel="stylesheet">
<h1 style="font-size:400%;" class="title">A Tribute to Taylor Swift<h1>
<img class="mainImg" src="http://sizlingpeople.com/wp-content/uploads/2016/02/Taylor-Swift-2016.jpg" alt="Performing at Times Square in New York">
<blockquote class="quote"><i>"Fearless is getting back up and fighting for what you want over and over again … even though every time you've tried before, you've lost."</i></blockquote>
<Br>
<p class="title2">Who is she?</p>
<span class="quote2"><i>"I'm very aware and very conscious of the path I chose in life, and very aware of the path I didn't choose."</i></span>
<p class="content"><b>Bio:</b> Taylor Swift was born on December 13, 1989 in Pennsylvania, and grew up in a modest farm enviornment to a financial advisonr and a stay-at-home mom.
<br><br><b>Music Development:</b> She discovered her love of music early on in her youth. Artists like Shania Twain and Faith Hill inspired her to begin focusing on country music - music that made her "want to just run around the block four times and daydream about everything." After breaking the record as youngest person to single-handedly write and perform a number-one song on the Hot Country Songs chart and creating the best-selling album of 2009 in the United States, Swift took over the pop genre. Her fifth album, <i>1989</i>, made her become the first act to have three albums sell a million copies within one week in the United States - which also made Swift the first woman to win Album of the Year twice.<br><br><b>Success:</b>Today, Swift has won over 230 awards and has been nominated over 500 times.
<br><br>
<ol class="bullets"><b>Mentionables:</b><br><br>On Forbes
<li>2017 - 30 Under 30
<li>2016 - Celebrity 100
<li>2016 - America's Self-Made Woman
<li>2015 - Power Women
</ol>
</p>
<ul class="rows">
<li>
<img src="https://itrainsinmyheart.files.wordpress.com/2012/03/screenshot-16h-00m-33s.jpg" width="300" height="200">
<span class="textOverlay">
<span><p style="font-size:18pt;">Romantic</p>
<Br>
<i> You'll be the prince and I'll be the princess.<Br>
It's a love story, baby, just say yes.<br>-Love Story</i>
</span>
</span>
<li>
<img src="https://i2.mirror.co.uk/incoming/article4626619.ece/ALTERNATES/s615/MAIN-Taylor-Swift-TIME-magazine.jpg" width="300" height="200">
<span class="textOverlay">
<span><p style="font-size:18pt;">Business Genius</p>
<Br>
<i>"The business aspect is one of the most important things about having a music career, because every choice you make in a management meeting affects your life a year-and-a-half from now."</i>
</span>
</span>
<li>
<img src="https://media.giphy.com/media/2KK7iD3tiUcbC/giphy.gif" width="300" height="200">
<span class="textOverlay">
<span><p style="font-size:18pt;">Performer</p>
<Br>
<i> When you walk out onstage in front of 65,000 people, it can bring you to tears.</i>
</span>
</span>
<br>
<li>
<img src="https://s-media-cache-ak0.pinimg.com/736x/f3/71/22/f371228b4c0b7cf03cb2ecb03a1dc543.jpg" width="300" height="200">
<span class="textOverlay">
<span><p style="font-size:18pt;">Artist</p>
<Br>
<i> I've always felt music is the only way to give an instananeous moment the feel of slow motion. To romanticize it and glorify it and give it a soundtrack and a rhythm.</i>
</span>
</span>
</ul>
<p style="text-align:center; font-size:14pt;">For source and more information, click <a href="https://en.wikipedia.org/wiki/Taylor_Swift" target="_blank">here</a> to go open wiki/Taylor_Swift.</p>
body {
background-color:black;
background-image: url("http://www.sepeb.com/cool-stream-wallpapers/image_20170302_110546_36291.jpg");
background-size: 100%;
background-repeat:no-repeat;
background-attachment: fixed;
color:#dbbc5d;
}
h1.title {
font-family: Satisfy, cursive;
opacity: .7;
text-shadow: 0 0 0.2em #F87;
font-position: center;
text-align: center;
padding: 30px 20px 20px 20px;
}
p.title2 {
font-family: Satisfy, cursive;
margin: 20px;
text-shadow: 0 0 0.2em #F87;
font-position: center;
text-align: center;
}
blockquote.content {
font-type:Arial;
font-size: 13pt;
max-width:700px;
width: 90%;
margin: 0 auto;
}
blockquote.quote {
font-size: 18pt;
border-radius: 25px;
font-family: Times New Roman;
color: #f4ccce;
background-color:rgba(000, 0,0, 0.5);
max-width:820px;
width: 90%;
margin: 0 auto;
margin-top: 10px;
padding: 10px;
}
span.quote2 {
font-size: 14pt;
text-align: center;
width: 90%;
max-width: 820px;
margin: 0 auto;
margin-bottom: 10px;
padding: 10px;
display:table;
border-radius: 25px;
font-family: Times New Roman;
color: #f4ccce;
background-color:rgba(000, 0,0, 0.5);
}
IMG.mainImg {
height: auto;
max-width: 90%;
display: block;
margin-left: auto;
margin-right: auto;
border: 1px solid grey;
padding:10px;
}
.content {
font-size: 16px;
line-height: 18px;
text-align: justify;
margin: 0 auto;
max-width: 820px;
width: 90%;
padding: 10px;
font-family: Arial;
color: #dbbc5d;
background-color:rgba(000, 0,0, 0.8);
}
ol.bullets {
font-size: 16px;
font-decoration:bold;
margin: 0 auto;
max-width: 820px;
width: 90%;
padding: 10px;
font-family: Arial;
color: #dbbc5d;
background-color:rgba(000, 0,0, 0.8);
}
ol.bullets li{
list-style-type:none;
line-height: 0;
font-size: 16px;
margin: 0 auto;
width: 820px;
padding: 10px;
border-radius: 25px;
font-family: Arial;
color: #dbbc5d;
}
ul.rows {
list-style-type:none;
margin:0;
padding: 0;
text-align: center;
}
ul.rows li {
display: inline-block;
height:200px;
width:300px;
margin: 0 1em 1em 0;
position:relative;
}
span.textOverlay span{
display:table-cell;
text-align:left;
vertical-align:middle;
font-size:12pt;
text-shadow: 0 0 0.2em #000;);
}
span.textOverlay {
background: rgba(0,0,0,0.5);
display:table;
height:200px;
width:300px;
left:0;
position:absolute;
top:0;
opacity:0;
}
ul.rows li:hover span.textOverlay {
opacity:1;
}
Also see: Tab Triggers