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.
<body>
<div>
<div class="dimBg"></div>
</div>
<div class="navHolder">
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="ambient" class="navIcon"><span class="navIcon-base">ambient</span></a>
<div class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">ambient house</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">ambient industrial</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">ambient noise</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">ambient pop</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">ambient techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">black ambient</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">chill out</span></a><br>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="nudisco" class="navIcon"><span class="navIcon-base">nu disco</span></a>
<div class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">nudisco</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">cosmic disco</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">dance-pop</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">dance-rock</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">disco</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">euro disco</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">italo disco</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="house" class="navIcon"><span class="navIcon-base">house</span></a>
<div class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">2-step garage</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">acid house</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">balearic beat</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">bassline</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">booty house</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">breakstep</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">bubblegum dance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="electronica" class="navIcon"><span class="navIcon-base">electronica</span></a>
<div id="electronicaSub" class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">acousmatic</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">aggrotech</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">alternative dance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">berlin school</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">bitpop</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">bleep techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">chillwave</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="techno" class="navIcon"><span class="navIcon-base">techno</span></a>
<div class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">acid techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">bleep techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">detroit techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">experimental techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">free tekno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">ghettotech</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">hardcore techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="dubstep" class="navIcon"><span class="navIcon-base">dubstep</span></a>
<div class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">acid freaks</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">afro-dub</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">aquacrunk</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">baltimore club</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">big beat</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">breakbeat</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">broken beat</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="trance" class="navIcon"><span class="navIcon-base">trance</span></a>
<div class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">acid trance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">anthem trance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">dark psytrance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">dark trance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">dream trance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">euro trance</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">full on</span></a><br>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
<li class="subMenu">
<ul>
<li class="subMenu">
<a href="#" id="hardcore" class="navIcon"><span class="navIcon-base">hardcore</span></a>
<div class="subMenu-content subNav">
<a href="#" class="navIcon"><span class="navIcon-base">4-beat</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">bouncy techno</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">breakbeat hardcore</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">breakcore</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">darkcore</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">digital hardcore</span></a>
<a href="#" class="navIcon"><span class="navIcon-base">doomcare</span></a><br>
<a href="#" class="navIcon"><span class="navIcon-base">more</span></a>
</div>
</li>
</ul>
</li>
</div>
<div class="fourbtns">
<div class="colWrapper">
<div id="topHundred" class="leftCol">Ambient</div>
<div id="music" class="rtCol">New Disco</div>
</div>
<div class="colWrapper">
<div id="creators" class="leftCol">House</div>
<div id="login" class="rtCol">Electronica</div>
</div>
<div class="colWrapper">
<div id="creators" class="leftCol">Techno</div>
<div id="login" class="rtCol">Dubstep</div>
</div>
<div class="colWrapper">
<div id="creators" class="leftCol">Trance</div>
<div id="login" class="rtCol">Hardcore</div>
</div>
</div>
</body>
* {
text-decoration: none;
}
body {
font-family: "Michroma", sans-serif;
background: white;
padding: 0;
margin: 0;
}
.dimBg {
background-color: black;
width: 100%;
height: 500px;
position: absolute;
top: 0px;
opacity: 0.7;
display: none;
z-index: 1;
}
.navHolder {
text-align: right;
margin: 0 70px 0 0;
}
.bg {
background: transparent url(bg.jpg) scroll no-repeat 0 -63px /100% auto;
width: 100%;
height: 600px;
position: absolute;
top: 69px;
}
.subMenu {
display: inline-block;
position: relative;
display: inline-block;
}
.subMenu-content {
position: absolute;
display: none;
z-index: 1;
text-align: left;
margin-top: 2px;
}
.subMenu-content a {
border-radius: 0 7px 7px 0px;
text-decoration: none;
margin: 1px 0;
color: black;
padding: 0;
}
.subMenu ul {
padding: 0 0 0 25px;
}
.subMenu:hover .subMenu-content {
display: block;
}
.subMenu:hover .dropbtn {
background-color: #3e8e41;
}
.subNav .navIcon-base {
padding: 0 10px 0px 16px;
line-height: 25px;
max-width: 140px;
font-size: 12px;
color: black;
}
.subNav .navIcon::before {
border-radius: 0 0 0 4px;
transform: rotate(45deg);
width: 18px;
height: 18px;
top: 4px;
left: -10px;
}
.navIcon {
transition: transform 0.3s 0.1s, opacity 0.3s ease-in-out;
display: inline-block;
position: relative;
margin: 0;
}
.navIcon::before {
border-bottom: 1px solid black;
border-left: 1px solid black;
transform: rotate(45deg);
border-radius: 0 0 0 4px;
background: white;
height: 24px;
width: 24px;
left: -13px;
top: 5px;
}
.navIcon:after,
.navIcon:before {
transition: border-color 0.1s ease-in-out, background-color 0.1s ease-in-out;
position: absolute;
content: "";
}
.navIcon::after {
border: 1px solid black;
margin: -4px 0 0 2px;
border-radius: 50%;
width: 6px;
height: 6px;
left: -4px;
z-index: 1;
top: 50%;
}
.navIcon:hover:after,
.navIcon:hover:before {
transition: border-color 0.1s ease-in-out, background-color 0.1s ease-in-out;
}
.navIcon:hover .navIcon-base {
transition: color 0.1s ease-in-out, border-color 0.1s ease-in-out,
background-color 0.1s ease-in-out;
}
/* ELECTRONICA */
#electronica.navIcon:hover:after,
#electronica.navIcon:hover:before {
border-color: #fc4c02;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#electronica.navIcon:hover:before {
background-color: #fc4c02;
}
#electronica.navIcon:hover .navIcon-base {
color: white;
border-color: #fc4c02;
background-color: #fc4c02;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#electronica span {
border-top: 1px solid #fc4c02;
border-right: 1px solid #fc4c02;
border-bottom: 1px solid #fc4c02;
}
#electronica::before {
border-left: 1px solid #fc4c02;
border-bottom: 1px solid #fc4c02;
}
/* DUBSTEP */
#dubstep.navIcon:hover:after,
#dubstep.navIcon:hover:before {
border-color: #00b140;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#dubstep.navIcon:hover:before {
background-color: #00b140;
}
#dubstep.navIcon:hover .navIcon-base {
color: white;
border-color: #00b140;
background-color: #00b140;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#dubstep span {
border-top: 1px solid #00b140;
border-right: 1px solid #00b140;
border-bottom: 1px solid #00b140;
}
#dubstep::before {
border-left: 1px solid #00b140;
border-bottom: 1px solid #00b140;
}
/* TECHNO */
#techno.navIcon:hover:after,
#techno.navIcon:hover:before {
border-color: #00b140;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#techno.navIcon:hover:before {
background-color: #00b140;
}
#techno.navIcon:hover .navIcon-base {
color: white;
border-color: #00b140;
background-color: #00b140;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#techno span {
border-top: 1px solid #00b140;
border-right: 1px solid #00b140;
border-bottom: 1px solid #00b140;
}
#techno::before {
border-left: 1px solid #00b140;
border-bottom: 1px solid #00b140;
}
/* HARDCORE */
#hardcore.navIcon:hover:after,
#hardcore.navIcon:hover:before {
border-color: #000000;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#hardcore.navIcon:hover:before {
background-color: #000000;
}
#hardcore.navIcon:hover .navIcon-base {
color: white;
border-color: #000000;
background-color: #000000;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#hardcore span {
border-top: 1px solid #000000;
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
}
#hardcore::before {
border-left: 1px solid #000000;
border-bottom: 1px solid #000000;
}
/* HOUSE */
#house.navIcon:hover:after,
#house.navIcon:hover:before {
border-color: #886b25;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#house.navIcon:hover:before {
background-color: #886b25;
}
#house.navIcon:hover .navIcon-base {
color: white;
border-color: #886b25;
background-color: #886b25;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#house span {
border-top: 1px solid #886b25;
border-right: 1px solid #886b25;
border-bottom: 1px solid #886b25;
}
#house::before {
border-left: 1px solid #886b25;
border-bottom: 1px solid #886b25;
}
/* NUDISCO */
#nudisco.navIcon:hover:after,
#nudisco.navIcon:hover:before {
border-color: #da1884;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#nudisco.navIcon:hover:before {
background-color: #da1884;
}
#nudisco.navIcon:hover .navIcon-base {
color: white;
border-color: #da1884;
background-color: #da1884;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#nudisco span {
border-top: 1px solid #da1884;
border-right: 1px solid #da1884;
border-bottom: 1px solid #da1884;
}
#nudisco::before {
border-left: 1px solid #da1884;
border-bottom: 1px solid #da1884;
}
/* TRANCE */
#trance.navIcon:hover:after,
#trance.navIcon:hover:before {
border-color: #5c068c;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#trance.navIcon:hover:before {
background-color: #5c068c;
}
#trance.navIcon:hover .navIcon-base {
color: white;
border-color: #5c068c;
background-color: #5c068c;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#trance span {
border-top: 1px solid #5c068c;
border-right: 1px solid #5c068c;
border-bottom: 1px solid #5c068c;
}
#trance::before {
border-left: 1px solid #5c068c;
border-bottom: 1px solid #5c068c;
}
/* AMBIENT */
#ambient.navIcon:hover:after,
#ambient.navIcon:hover:before {
border-color: #a7c6ed;
background-color: white;
transition: border-color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
#ambient.navIcon:hover:before {
background-color: #a7c6ed;
}
#ambient.navIcon:hover .navIcon-base {
color: white;
border-color: #a7c6ed;
background-color: #a7c6ed;
transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out,
background-color 0.2s ease-in-out;
}
#ambient span {
border-top: 1px solid #a7c6ed;
border-right: 1px solid #a7c6ed;
border-bottom: 1px solid #a7c6ed;
}
#ambient::before {
border-left: 1px solid #a7c6ed;
border-bottom: 1px solid #a7c6ed;
}
.navIcon-base {
transition: color 0.1s ease-in-out, border-color 0.1s ease-in-out,
background-color 0.1s ease-in-out;
border-bottom: 1px solid black;
border-right: 1px solid black;
border-top: 1px solid black;
border-radius: 0 7px 7px 0;
padding: 0 10px 2px 13px;
background-color: white;
text-overflow: ellipsis;
letter-spacing: 0.3px;
white-space: nowrap;
position: relative;
line-height: 31px;
user-select: none;
overflow: hidden;
max-width: 160px;
cursor: pointer;
font-size: 12px;
display: block;
color: black;
}
.slicknav_menu,
#menu {
display: none;
}
.leftCol {
float: left;
width: 50%;
padding: 10px 0;
border-right: 1px solid white;
}
.colWrapper {
text-align: center;
color: white;
border-bottom: 1px solid white;
overflow: auto;
}
.fourbtns {
position: absolute;
width: 100%;
margin: 0;
background-color: #218eb2;
color: white;
text-align: center;
display: none;
top: 0;
}
.rtCol {
padding: 10px 0;
margin-left: 50%;
}
#topHundred:hover,
#music:hover,
#creators:hover,
#login:hover {
background-color: #36b0cc;
}
@media screen and (max-width: 1000px) {
.navIcon-base {
max-width: none;
}
.bg {
background: transparent url(bg.jpg) scroll no-repeat 0 -81px /100% auto;
position: static;
margin: 142px 0 0 0;
}
.subMenu {
display: none;
}
/* MOBILE TAGS */
.navIcon::before {
left: 17px;
top: 6px;
}
.navIcon::after {
left: 25px;
}
.mobileTags::before {
top: 22px;
left: -13px;
}
.mobileTags::after {
margin: 19px 0 0 2px;
left: -3px;
}
.fourbtns {
display: block;
}
}
Also see: Tab Triggers