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 URL's 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 it's URL and the proper URL extention.
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 Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
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.
<a href="#openModal" class="trigger">OPEN MODAL</a>
<div id="openModal" class="modalDialog">
<div>
<a href="#close" title="Close" class="close">x</a>
<h2>Modal Box</h2>
<p>This is a sample modal box that can be created using CSS3.</p>
</div>
</div>
<a href="http://www.sergioluna.com" target="_blank" class="logo">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" x="0px" y="0px" width="61px" height="60px" viewBox="0 0 806 800" enable-background="new 0 0 806 800" xml:space="preserve">
<g>
<path d="M732.066 190.526C660.111 77.5 536.9 10 402.4 10.009c-74.064 0-146.312 21.067-208.922 60.9 C105.756 126.8 45 213.6 22.4 315.472C-0.257 417.3 18.1 521.7 73.9 609.5 c71.947 113 195.2 180.5 329.6 180.512h0.029c74.053 0 146.287-21.066 208.896-60.923 c87.773-55.87 148.564-142.717 171.176-244.536C806.258 382.7 787.9 278.3 732.1 190.526z M224.229 453.4 c0.182 25.4 0.4 51.68-6.192 72.615c-6.772 21.611-18.583 41.525-35.215 59.432c-8.217-9.77-15.8-20.093-22.663-30.875 c-85.236-133.897-45.646-312.181 88.257-397.42c46.181-29.396 99.452-44.936 154.05-44.936 c99.297 0 190.3 49.8 243.4 133.192c7.481 11.8 14.1 24.1 19.8 36.744l-178.54 113.991l0.187-210.168l-70.789 29.5 c-0.498 0.205-50.514 21.093-95.538 49.75c-28.96 18.438-50.93 36.957-65.298 55.049C223.56 360.7 223.9 409.9 224.2 453.4 z M315.581 556.593c11.353-36.228 11.094-72.194 10.864-103.928c-0.199-27.855-0.407-56.657 9.269-68.845 c4.099-5.161 14.764-16.23 40.145-32.385c2.919-1.862 5.945-3.731 9.067-5.606l-0.208 236.708l305.974-195.174 c4.712 101.974-45.081 199.434-133.111 255.474c-46.176 29.392-99.436 44.928-154.024 44.9 c-49.468 0-98.922-13.055-141.99-37.161C286.511 622.5 305 590.4 315.6 556.593z"
class="style0" />
</g>
</svg> www.sergioluna.com
</a>
body {
background-color: black;
font-family: 'Montserrat', sans-serif;
background-image: repeating-linear-gradient(15deg, transparent, transparent 12px, rgba(255,255,255,.03) 12px, rgba(255,255,255,.03) 40px);
margin: 10px;
font-family: Arial, Tahoma;
font-size: 20px;
text-align: center;
}
.logo{
width:150px;
color:#222;
display:block;
font-weight:300;
text-decoration:none;
text-align:center;
line-height:30px;
font-size:14px;
font-family: 'Montserrat', sans-serif;
margin:0 auto;
padding:80px;
position:relative;
}
a.logo, svg.style0 {
color:#111;
fill:#111;
-webkit-transition: color 0.5s ease, fill 0.5s ease;
-moz-transition: color 0.5s ease, fill 0.5s ease;
-o-transition: color 0.5s ease, fill 0.5s ease;
transition: color 0.5s ease, fill 0.5s ease;
}
a.logo:hover, svg.style0:hover {
color:#666;
fill:#666;
}
a.trigger{
display:block;
position:relative;
margin:0 auto;
margin-top:50px;
width:220px;
height:165px;
padding-top:55px;
border-radius:250px;
color: orange;
font-family: 'Montserrat', sans-serif;
font-weight:300;
text-decoration:none;
font-size:2em;
line-height:1.2em;
background:#ec1f2c;
transition: 0.1s;
transform: rotate(10deg);
border:15px solid orange;
}
a.trigger:hover{
transform: rotate(0deg);
color:yellow;
border:15px solid yellow;
}
h1 { color: #eeeeee;
font-family: 'Montserrat', sans-serif;
font-weight:300;
line-height:120px;
text-transform:uppercase;
font-size:32px;
}
h2 { color: #333;
font-family: 'Montserrat', sans-serif;
font-weight:300;
line-height:40px;
text-transform:uppercase;
font-size:32px;
}
/*modal styles begin*/
.modalDialog {
position: fixed;
font-family: Arial, Helvetica, sans-serif;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0,0,0,0.8);
z-index: 99999;
opacity:0;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in;
pointer-events: none;
}
.modalDialog:target {
opacity:1;
pointer-events: auto;
}
.modalDialog > div {
width: 400px;
position: relative;
margin: 10% auto;
padding: 5px 20px 13px 20px;
border-radius: 3px;
background: #fff;
}
.close {
background: #606061;
color: #FFFFFF;
line-height: 25px;
position: absolute;
right: -12px;
text-align: center;
top: -10px;
width: 24px;
text-decoration: none;
font-weight: bold;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
-moz-box-shadow: 1px 1px 3px #000;
-webkit-box-shadow: 1px 1px 3px #000;
box-shadow: 1px 1px 3px #000;
}
.close:hover { background: #00d9ff; }
/*modal styles end*/
Also see: Tab Triggers