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.
<!-- TASK 12- STYLESHEET- I added doctype, all element names are lowercase, and all elements are closed. All attribute names are lowercase,and attribute values are quoted. All images have width, height, and alt. There are no spaces after =, and I added the lang attribute. -->
<!DOCTYPE html>
<!--new background image-->
<html lang="en-us">
<!--TASK 10-HEAD ELEMENTS-->
<head>
<!--TASK 11 RESPONSIVE DESIGN-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Valentines Day</title>
<!--TASK 7 COLOR PICKER AND TASK 8- CLASSES+IDS+CSS STYLES-->
<style>
h2 {
font-size: 150%;
color: white;
border: 2px solid powderblue;
}
.note {
font-size: 120%;
color: white;
}
body {
background-color:
#cc99ff;
}
#valentinesDay {
background-color: #fa86c;
color: #e11584;
text-align: center;
}
#wiseQuote {
background-color: black;
color: white;
text-align: center;
}
/*TASK 11 LAYOUT*/
#girraffe {
float: right;
}
#table {
float: right;
}
table,
th,
td {
border: 1px solid black;
border-collapse: collapse;
font-size: 140%;
}
/*TASK 11 RESPONSIVE LAYOUT*/
@media (max-width: 600px) {
nav,
article {
width: 100%;
height: auto;
}
</style>
</head>
<!-- TASK 8 IDS-->
<!--TASK 11 RESPONSIVE TEXT-->
<h1 style="font-size:10vw" id="valentinesDay"> <strong>đź’—Valentines Dayđź’— </strong> </h1>
<!--line two-->
<h2 style="font-size:2vw"> <i> Gool ol' February 14th </i> </h2>
<!--line three/ TASK 8-USING CLASS-->
<h4 style="font-size:1vw;color:#e11584; width:30%;font-family:courier new; border:5px solid white"> Sadly, this day stopped being fun after we no longer got <span class="note"> immense </span> amounts of candy from our classmates.
<h4 />
<!--TASK 7+ TASK 8 IDS-->
<p id="wiseQuote">The wise Ted Koosner once said: <q id="wiseQuote">Valentine’s Day is the poet’s holiday.</q></p>
<p style="font-size:1vw;color:black;">Here is a poem by Joanna Fuchs:</p>
<!--TASK 8 USING CLASS-->
<blockquote style="color:black;font-size:1vw" cite="https://www.poemsource.com/short-love-poems.html"> <span class="note">
I never knew about happiness;
I didn’t think dreams came true;
I couldn’t really believe in love,
Until I finally met you.
</span>
</blockquote>
<!--line four with link-->
<a href="https://www.goodhousekeeping.com/holidays/valentines-day-ideas/g1409/best-valentines-day-chocolates//" target="_blank">Heres a list of the best Valentines Day candy to avoid getting the weird fruit filled mystery chocolates that <mark>nobody</mark>likes. </a>
<!--line five-->
<h5> (It is now far past Valentines day and I regret making it the theme.)
<h5 />
<p> <a href="mailto:violet.singer1000@gmail.com">But it's not too late if you still want to send me a Valentines message!</a></p>
<!--three girrafe images-->
<!--the first and second are links-->
<!--TASK 10 FILE PATHS-->
<a id="girraffe" href="https://www.designbolts.com/wp-content/uploads/2014/01/Cute-love-image1.jpg"> <img src="https://i.postimg.cc/6QtVQMK7/Screen-Shot-2021-02-19-at-11-53-11-AM.png" alt="Girraffe" style="width:150px;height:150px;"></a>
<a href="https://app.box.com/s/37r1ickgllp3yqtrxwy43agplkaknsab"><img src="https://i.postimg.cc/6QtVQMK7/Screen-Shot-2021-02-19-at-11-53-11-AM.png" alt="Girraffe" style="width:200px;height:200px;"></a>
<img src="https://i.postimg.cc/6QtVQMK7/Screen-Shot-2021-02-19-at-11-53-11-AM.png" alt="girraffe" style="width:150px;height:150" </img>
</html>
<!--TASK 9-TABLE-->
<table id="table" style="width:50%">
<tr>
<th>Name</th>
<th colspan="2">Favorite Colors</th>
</tr>
<tr>
<td>Violet</td>
<td style="color:#c7ffcc">This Green</td>
<td style="color:#c7ffff">This Blue</td>
</tr>
<tr>
<td>Jack</td>
<td style="color:#33cc00">This Green</td>
<td style="color:#0066ff">This Blue</td>
</table>
<!--TASK 9 LISTS-->
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
<ul>
<li>Pasta</li>
<li>Pasta Sauce</li>
<li>Mushrooms</li>
<li>Parmesean</li>
</ul>
<!--TASK 9 HORIZONTAL MENU-->
<p><span id="horizontalMenu">Hi</span>
<span id="horizontalMenu">Hello</span>
<span id="horizontalMenu">Hey</span>
</p>
<!--TASK 10- IFRAME-->
<iframe src="https://www.violetsinger.com" style="height:400px;width:600px;" title="My Website"></iframe>
body {
font-family: courier new;
background-color: #fec5e5;
color: #e11584;
height: 100vh;
margin: 0;
display: grid;
place-items: center;
}
h1 {
background-color: #fa86c4;
}
#valentinesDay {
background-color: #fa86c;
color: #e11584;
text-align: center;
}
#wiseQuote {
background-color: black;
color: white;
text-align: center;
}
#horizontalMenu{
background-color: white;
}
h2 {
background-color: #cc99ff;
color: #ffd8f0;
padding: 0px 13px;
}
p {
padding: 0px 250px;
}
a {
color: #c71585;
}
document.getElementsByTagName("h1")[0].style.fontSize = "4vw";
Also see: Tab Triggers