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.
<!-- Everything here goes inside of your <body></body> tags! -->
<div class="container">
<!-- top of the page links: -->
<div class="header">
<div class="header-left">
<a href="#">YOUR_USERNAME_HERE</a>: <a href="#">weblog</a> - <a href="#">photos</a> - <a href="#">videos</a> - <a href="#">audio</a> - <a href="#">pulse</a> - <a href="#">profile</a> - <a href="#">subscribe!</a>
</div>
<div class="header-right">
<a href="#">review</a> - <a href="#">ratings</a> - <a href="#">flag</a> [ <a href="#">xanga</a> - <a href="#">join</a> - <a href="#">sign in</a> ]
</div>
</div>
<!-- main content -->
<div class="flex">
<!-- sidebar -->
<div class="left">
<div class="box">
<div class="boxwrap">
<div class="subtitle"><strong>YOUR_USERNAME_HERE</strong></div>
<a href="#">read my profile</a><br>
<a href="#">sign my guestbook</a><br><br>
<br>
<strong>Message:</strong> <a href="#">message me</a><br><br>
<strong>Member Since:</strong> 6/30/2006
</div>
</div>
<div class="box">
<div class="boxwrap">
<div class="subtitle">Subscriptions</div>
<a href="#">Subscribe to YOUR_USERNAME_HERE</a><br>
<a href="#">Get trial subscription</a><br>
</div>
</div>
<div class="box">
<div class="boxwrap">
<div class="subtitle">My Blogrings</div>
<a class="blogring" href="#">Blogring Name</a>
<div class="blogringLinks">
<a href="#">previous</a> - <a href="#">random</a> - <a href="#">next</a>
</div>
</div>
</div>
<div class="box">
<div class="boxwrap">
<div class="subtitle">Posting Calendar</div>
</div>
</div>
</div>
<!-- content -->
<div class="right">
<div class="post">
<div class="date">Friday, October 15, 2021</div>
<div class="title">Remember Xanga?</div>
<div class="entry">
<p>I spent way too many hours growing up, making Xanga accounts of every kind possible. I liked using it for journaling, writing, and roleplaying.</p>
<p>This is a simple HTML/CSS recreation of the original Xanga theme. This means <em>every part of it</em> can be customized. Don't like the links in the sidebar? Yeet them! This layout is your oyster.</p>
<p>Enjoy some catsum ipsum, my favorite :3</p>
<p>Catch mouse and gave it as a present kitty run to human with blood on mouth from frenzied attack on poor innocent mouse, don't i look cute? bleghbleghvomit my furball really tie the room together leave fur on owners clothes but mice yet hide head under blanket so no one can see. Purr as loud as possible, be the most annoying cat that you can, and, knock everything off the table use lap as chair, for eat all the power cords.</p>
<p>Sit on the laptop scratch so owner bleeds for snuggles up to shoulders or knees and purrs you to sleep if human is on laptop sit on the keyboard, yet lick left leg for ninety minutes, still dirty or in the middle of the night i crawl onto your chest and purr gently to help you sleep. Love to play with owner's hair tie hide from vacuum cleaner. Cat dog hate mouse eat string barf pillow no baths hate everything.
<p>Meow meow attack the dog then pretend like nothing happened chase little red dot someday it will be mine! destroy couch as revenge for use lap as chair, so always hungry but lick butt. Be a nyan cat, feel great about it, be annoying 24/7 poop rainbows in litter box all day mrow yet catching very fast laser pointer. Carrying out surveillance on the neighbour's dog. Sleeps on my head waffles, so pet me pet me don't pet me so stand with legs in litter box, but poop outside check cat door for ambush 10 times before coming in for hack up furballs, curl into a furry donut. Touch water with paw then recoil in horror. Cats are the world.</p>
</div>
<div class="postFooter"><a href="#">6:34 PM</a> - <a href="#">2 eProps</a> - <a href="#">add comments</a> - <a href="#">email it</a></div>
</div>
</div>
</div>
<!-- footer -->
<div class="footer">
<a href="#">xanga</a> - <a href="#">your site</a> - <a href="#">terms</a> - <a href="#">privacy</a> - <a href="#">jobs</a> - <a href="#">help</a> - <a href="#">press</a> - <a href="#">join</a> - <a href="#">Language</a><br><br>
<a href="#">safety</a> - <a href="#">parents</a> - <a href="#">law enforcement</a><br><br>
<a href="#">report inappropriate content</a>
<br><br>
This layout was lovingly re-crafted by <a href="https://sadgrl.online/">sadgrl.online</a>
</div>
/* You can either copy the below and paste it between style tags on your HTML page, OR you can copy this to a file and name it .css and link it from your HTML page. */
:root {
--font-family:"Verdana", sans-serif;
--font-size:x-small;
--sidebar-border:1px solid #E6E6C3;
--link-color:blue;
--bg-color:white;
--text-color:black;
--sidebar-bg:transparent;
--content-bg:transparent;
--content-padding:0;
--background-image:none;
/* for bg image, above would be url('site.com/image.jpg'); */
}
body {
font-family:var(--font-family);
font-size:var(--font-size);
background-color:var(--bg-color);
color:var(--text-color);
background-image:var(--bg-image);
}
body a {
color:var(--link-color);
}
.left {
width:200px;
display:flex;
flex-wrap:wrap;
}
.box {
width:200px;
border:var(--sidebar-border);
margin-bottom:15px;
padding-bottom:10px;
background-color:var(--sidebar-bg);
}
.flex {
display:flex;
}
.container {
max-width:700px;
margin:0 auto;
}
.right {
margin-left:10px;
background-color:var(--content-bg);
padding:var(--content-padding);
}
.subtitle {
font-weight:bold;
padding-top:3px;
margin-bottom:5px;
}
.boxwrap {
padding-left:10px;
padding-bottom:5px;
}
.footer {
text-align:center;
}
.header {
display:flex;
flex-spacing:space-between;
padding-bottom:10px;
}
.header-left {
width:60%;
}
.header-left a {
font-weight:bold;
}
.header-right {
text-align:right;
width:40%;
}
content {
display:flex;
margin:0 auto;
width:700px;
}
.post .title {
font-size:16px;
font-weight:bold;
margin-bottom:10px;
padding-left:10px;
}
.post .date {
margin-bottom:10px;
}
.entry {
padding-left:10px;
}
.postFooter {
padding-top:10px;
padding-left:10px;
}
.blogring {
font-size:11px;
font-weight:bold;
}
.boxwrap img {
width:130px;
display:block;
}
@media only screen and (max-width: 730px) {
.flex {
flex-wrap:wrap;
}
.right {
width:100%;
order:1;
}
.left {
width:100%;
order:2;
display:flex;
flex-wrap:wrap;
align-self:center;
justify-content:center;
margin-top:20px;
}
}
Also see: Tab Triggers