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.
Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.
Upgrade to PROIf 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.
Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.
Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.
PRO members can see and edit the Pen thumbnail here after the Pen has been saved.
<!-- this code is a mess imo, apologies! everything is tagged for ease of changing the code, commented where helpful -->
<div id="container">
<!-- container wraps around all content, allows for easier styling -->
<div id="top-flex">
<!-- this div wraps around the icon div and nav for styling -->
<div id="icon"></div>
<nav>
<ul class="nav">
<li><a href="#">
<div class="linkimg"><img src="https://static.miraheze.org/simswiki/e/e8/Bella_Goth-icon.png" height="100px"></div>link
</a></li>
<li><a href="#">
<div class="linkimg"><img src="https://static.miraheze.org/simswiki/6/63/Lilith_Pleasant-icon.png" height="100px"></div>link
</a></li>
<li><a href="#">
<div class="linkimg"><img src="https://static.miraheze.org/simswiki/9/95/Cassandra_Goth-icon.png" height="100px"></div>link
</a></li>
<li><a href="#">
<div class="linkimg"><img src="https://static.miraheze.org/simswiki/8/8f/Dustin_Broke-icon.png" height="100px"></div>link
</a></li>
<li><a href="#">
<div class="linkimg"><img src="https://static.miraheze.org/simswiki/3/34/Daniel_Pleasant-icon.png" height="100px"></div>link
</a></li>
</ul>
</nav>
</div> <!-- top-flex div -->
<div id="middle-flex">
<!-- this div wraps around the left, middle, and right column divs for styling -->
<div id="left-column">
<div class="column-wrapper">
<!-- this wraps around the content of this column -->
<div class="links">
<div class="links-subtitle"> subtitle </div>
<ul class="links-list">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</div> <!-- links div -->
<div class="links">
<div class="links-subtitle"> subtitle </div>
<ul class="links-list">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</div> <!-- links div -->
<div class="links">
<div class="links-subtitle"> subtitle </div>
<ul class="links-list">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</div> <!-- links div -->
<img class="column-img" src="https://nofowle.neocities.org/images_home/boxing.png" alt="Boxing">
</div> <!-- column-wrapper div -->
</div> <!-- left-column div -->
<div id="middle-column">
<!-- middle-column will contain main in this template -->
<main>
<div id="banner"></div>
<article>
<div class="article-title">Title 1</div>
<div class="article-content">
Computers are like bikinis. They save people a lot of guesswork. (Sam Ewing) If debugging is the process of removing software bugs, then programming must be the process of putting them in. (Edsger Dijkstra) I’ve noticed lately that the paranoid fear of computers becoming intelligent and taking over the world has almost entirely disappeared from the common culture. Near as I can tell, this coincides with the release of MS-DOS. (Larry DeLuca) Before software can be reusable it first has to be usable. (Ralph Johnson)
</div> <!-- article-content div -->
</article>
<article>
<div class="article-title">Title 2</div>
<div class="article-content">
Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris. (Larry Wall) Any fool can use a computer. Many do. (Ted Nelson) Writing in C or C++ is like running a chain saw with all the safety guards removed. (Bob Gray) I’ve noticed lately that the paranoid fear of computers becoming intelligent and taking over the world has almost entirely disappeared from the common culture. Near as I can tell, this coincides with the release of MS-DOS. (Larry DeLuca) Good code is its own best documentation. (Steve McConnell) </div> <!-- article-content div -->
</article>
</main>
</div> <!-- middle-column div -->
<div id="right-column">
<!-- there's no right column in the original site but some may find use in having this! -->
<div class="column-wrapper">
<!-- this wraps around the content of this column -->
<img class="column-img" src="https://nofowle.neocities.org/images_home/biostation.png" alt="Biostation">
<div class="links">
<div class="links-subtitle"> subtitle </div>
<ul class="links-list">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</div> <!-- links div -->
<div class="links">
<div class="links-subtitle"> subtitle </div>
<ul class="links-list">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</div> <!-- links div -->
<div class="links">
<div class="links-subtitle"> subtitle </div>
<ul class="links-list">
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
<li><a href="#">link</a></li>
</ul>
</div> <!-- links div -->
</div> <!-- column-wrapper div -->
</div> <!-- right-column div -->
</div> <!-- center-flex div -->
<div id="bottom-flex">
<!-- this div wraps around the footer and an optional div for buttons -->
<div id="buttons">
<!-- stick buttons and badges in here! -->
<img class="button" src="https://www.internetbumperstickers.com/066811/l01/lookbest.gif" alt="This website looks best on company time">
<img class="button" src="https://www.internetbumperstickers.com/066811/d01/dolphin.gif" alt="This website is dolpin safe">
<img class="button" src="https://www.internetbumperstickers.com/066811/w01/web_cheese.gif" alt="This website made with 100% real cheese">
<img class="button" src="https://www.internetbumperstickers.com/066811/t01/taunt_wbmstr.gif" alt="Do not taunt the webmaster">
<img class="button" src="https://www.internetbumperstickers.com/066811/n01/no_loud.gif" alt="Please no loud noise after 11pm">
<img class="button" src="https://www.internetbumperstickers.com/066811/d01/dog_ate_webpage.gif" alt="Error 404 - File not found (the dog ate my web page)">
<img class="button" src="https://www.internetbumperstickers.com/066811/b01/blog_redbull.gif" alt="This blog runs on Red Bull">
<img class="button" src="https://www.internetbumperstickers.com/066811/w01/weasels_blog.gif" alt="This blog now with fewer weasels">
</div>
<footer> this is some footer text!
<div id="credits">
<!-- you're welcome to delete this but please consider leaving it as credit! I'd really appretiate it! --> coded with love by <a href="https://nofowle.neocities.org">nofowle</a>.<br> last updated on 8th Nov. 2022.<br>
wanna use this as a template? <a href="https://codepen.io/pen?template=MWXjzEO">click here!</a>
</div>
</footer>
</div> <!-- bottom-flex div -->
</div> <!-- container div -->
:root {
/* BACKGROUND COLORS */
--bg-color: #003062;
--columns-outside: #394995;
--links-inside: #7cadc5;
--main-inside: #747fc4;
--nav-outside: #394995;
--nav-inside: #747fc4;
/* BORDER COLORS*/
--columns-border: #2f3b7a;
--links-border: #6c96ab;
--main-border: #656eab;
--nav-border: #2f3b7a;
--nav-buttons-border: #656eab;
/* FONTS */
--font-fam: Signika Negative, Trebuchet MS, Arial, sans-serif;
--font-color: #000066;
--footer-font-color: #336699;
/* LINKS */
--links-color: #f0ec9f;
--links-hover: #add04f;
/* IMAGES */
--icon: url("https://nofowle.neocities.org/images_home/Sims2Logo.gif");
--banner: url("https://nofowle.neocities.org/images_home/Sims2BannerResized.jpg");
}
body {
background-color: var(--bg-color);
}
#container {
max-width: 960px;
}
#top-flex {
display: flex;
height: 150px;
max-height: 150px;
font-family: var(--font-fam);
color: var(--font-color);
}
#icon {
margin-right: 10px;
margin-bottom: 10px;
height: 150px;
max-height: 150px;
width: 150px;
max-width: 150px;
background-image: var(--icon);
background-repeat: no-repeat;
background-position: center;
}
nav {
border: 1px solid var(--nav-border);
border-radius: 8px 8px;
width: 800px;
max-width: 800px;
height: 145px;
min-height: 145px;
max-height: 300px;
display: flex;
justify-content: center;
align-items: text-bottom;
background-color: var(--nav-outside);
}
nav ul {
margin: 0;
padding: 0;
}
nav li {
display: inline-block;
font-size: 28px;
text-align: center;
}
nav a {
display: block;
color: var(--links-color);
text-decoration: none;
background-color: var(--nav-inside);
border: var(--nav-buttons-border);
border-radius: 10px 10px;
width: 155px;
max-width: 155px;
height: 138px;
max-height: 138px;
}
nav a:hover {
color: var(--links-hover);
}
.linkimg {
margin-top: 3px;
padding-top: 3px;
width: 100%;
height: 75%;
}
#middle-flex {
margin-top: 3px;
display: flex;
font-family: var(--font-fam);
color: var(--font-color);
}
#left-column {
border: 1px solid var(--columns-border);
border-radius: 8px 8px;
margin-right: 3px;
width: 150px;
max-width: 150px;
background-color: var(--columns-outside);
}
#right-column {
border: 1px solid var(--columns-border);
border-radius: 8px 8px;
margin-left: 3px;
width: 150px;
max-width: 150px;
background-color: var(--columns-outside);
}
.column-wrapper {
background-color: var(--links-inside);
margin: 5px;
border: 1px solid var(--links-border);
border-radius: 8px 8px;
}
.links {
margin: 5px;
}
.links ul {
margin: 0;
padding: 0;
}
.links li {
list-style-type: none;
font-size: 16px;
margin-bottom: 7px;
}
.links a {
color: var(--links-color);
text-decoration: none;
}
.links a:hover {
color: var(--links-hover);
}
.column-img {
width: auto;
max-width: 132px;
height: auto;
max-height: 132px;
margin: 3px;
display: flex;
justify-content: center;
border-radius: 8px 8px;
}
.links-subtitle {
padding: 2px;
margin-bottom: 3px;
font-size: 18px;
}
#middle-column {
border: 1px solid var(--columns-border);
border-radius: 8px 8px;
width: 100%;
max-width: 100%;
background-color: var(--columns-outside);
}
#banner {
border-radius: 8px 8px;
margin: 5px auto;
width: 638px;
max-width: 638px;
height: 120px;
max-height: 120px;
background-image: var(--banner);
background-repeat: no-repeat;
background-size: 638px;
background-position: center;
}
article {
border: 1px solid var(--main-border);
border-radius: 8px 8px;
margin: 5px;
background-color: var(--main-inside);
}
.article-title {
margin: 5px;
font-size: 20px;
padding-left: 2px;
}
.article-content {
margin: 5px;
}
#bottom-flex {
margin-top: 10px;
display: flex;
height: 100px;
font-family: var(--font-fam);
color: var(--font-color);
}
#buttons {
margin-right: 10px;
padding: 0;
width: 750px;
max-width: 750px;
}
.button {
width: auto;
max-width: 175px;
height: auto;
max-height: 175px;
display: inline-grid;
margin: 0;
padding: 0;
}
footer {
width: 200px;
max-width: 200px;
color: var(--footer-font-color);
text-align: right;
font-size: 15px;
}
#credits a {
text-decoration: none;
color: var(--links-color);
}
#credits a:hover {
color: var(--links-hover);
}
Also see: Tab Triggers