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.
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>My Website</title>
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@100&family=League+Spartan:wght@100&display=swap" rel="stylesheet" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<nav class="navbar">
<div class="navbar-container container">
<input type="checkbox" name="" id="" />
<div class="hamburger-lines">
<span class="line line1"></span>
<span class="line line2"></span>
<span class="line line3"></span>
</div>
<i class="fa-thin fa-bars"></i>
<ul class="menu-items">
<li><a style="float: left" href="#Intro">Intro</a></li>
<li><a style="float: left" href="#About">About</a></li>
<li><a style="float: left" href="#Codepen">Codepen</a></li>
<li><a style="float: left" href="#Github">Github</a></li>
<div class="dropdown">
<button style="float: right; background-color: black" class="dropbtn">
Dropdown
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href="#HTML">HTML</a>
<a href="#CSS">CSS</a>
<a href="#JavaScript">JavaScript</a>
</div>
</div>
</ul>
</div>
</nav>
<section id="Intro">
<p>Hello 👋 My Name Is</p>
<h1 class="name">Jay Pandya.</h1>
<h5 class="info">
I Code And <br />
Make Videos
</h5>
<div class="line"></div>
<p class="more_info">
I like coding because it is the best and did you know that, <br />
I like bike riding and composing music.
</p>
<br />
</section>
<section data-color="black" id="About">
<h1 class="name">About</h1>
<div class="line"></div>
<p style="padding-top: 20px">
I do many thing as a hobby. Things I like doing especially are cycling,
coding, gaming <br />
and posting things on my Codepen and Github
</p>
<br />
</section>
<section id="Codepen">
<h1 class="name">Codepen</h1>
<div class="line"></div>
<p style="padding-top: 20px">
Below is my Codepen, a place where I code more simple things.
</p>
<a style="
color: black;
padding-left: 20px;
font-family: League Spartan, sans-serif;
" href="https://codepen.io/CODERS-FOR-Life">My Codepen</a>
<br />
<a style="
color: black;
padding-left: 20px;
font-family: League Spartan, sans-serif;
" href="https://codepen.io/CODERS-FOR-Life/pen/dyJLgYj">My Website's Codepen</a>
</section>
<section id="Github">
<h1 class="name">Github</h1>
<div class="line"></div>
<p style="padding-top: 20px">
I have many repositories on Github. Mainly things on there I have just
created for fun.
</p>
<a style="
color: black;
padding-left: 20px;
font-family: League Spartan, sans-serif;
" href="https://github.com/CoderForLife123">My Github</a>
<br />
<a style="
color: black;
padding-left: 20px;
font-family: League Spartan, sans-serif;
" href="https://github.com/CoderForLife123/MY-WEBSITE">My Website's Github</a>
<div>
</section>
<br />
<br />
<section id="HTML" style="display: flex; align-items: baseline;">
<h1 class="name">HTML</h1>
<h5 class="info">
Its Easy Once...<br />
You Know How Do It
</h5>
<div class="line"></div>
<p class="more_info">
I like coding because it is the best and did you know that, <br />
I like bike riding and composing music.
</p>
<br />
</section>
<br />
<br />
<section id="CSS" style="display: flex; align-items: baseline;">
<h1 class="name">CSS</h1>
<h5 class="info">
I Code And <br />
Make Videos
</h5>
<div class="line"></div>
<p class="more_info">
I like coding because it is the best and did you know that, <br />
I like bike riding and composing music.
</p>
<br />
</section>
<br />
<br />
<section id="JavaScript" style="display: flex; align-items: baseline;">
<h1 class="name">JavaScript</h1>
<h5 class="info">
I Code And <br />
Make Videos
</h5>
<div class="line"></div>
<p class="more_info">
I like coding because it is the best and did you know that, <br />
I like bike riding and composing music.
</p>
<br />
</section>
</div>
<script></script>
<style>
body {
background-color: white;
height: 2000px;
}
p {
color: black;
font-size: 20px;
padding-left: 20px;
padding-top: 100px;
font-family: "Josefin Sans", sans-serif;
}
.color-black {
background-color: black;
}
.name {
background-color: #21d4fd;
background-image: linear-gradient(270deg, #21d4fd 0%, #3821ff 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 80px;
font-weight: 600;
padding-left: 20px;
font-family: "League Spartan", sans-serif;
}
.line {
height: 10px;
background-color: #21d4fd;
background-image: linear-gradient(270deg, #21d4fd 0%, #3821ff 100%);
width: 400px;
margin-left: 20px;
margin-top: 50px;
}
.info {
color: black;
font-size: 40px;
padding-left: 20px;
font-family: "Josefin Sans", sans-serif;
}
.more_info {
color: black;
font-size: 20px;
padding-left: 20px;
padding-top: 20px;
font-family: "Josefin Sans", sans-serif;
}
*,
*::after,
*::before {
box-sizing: border-box;
padding: 0;
margin: 0;
}
.html {
font-size: 62.5%;
}
.navbar input[type="checkbox"],
.navbar .hamburger-lines {
display: none;
}
.container {
max-width: 1200px;
width: 90%;
margin: auto;
}
.navbar {
box-shadow: 0px 5px 10px 0px #aaa;
position: fixed;
width: 100%;
background: #fff;
color: #000;
opacity: 0.85;
z-index: 100;
font-family: "League Spartan", sans-serif;
}
.navbar-container {
display: flex;
justify-content: space-between;
height: 64px;
align-items: center;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 16px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin-left: 20px;
font-family: "League Spartan", sans-serif;
}
.navbar a:hover,
.dropdown:hover .dropbtn {
background-color: red;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
font-family: "League Spartan", sans-serif;
}
.dropdown-content a:hover {
background-color: #ddd;
font-family: "League Spartan", sans-serif;
}
.dropdown:hover .dropdown-content {
display: block;
}
.menu-items {
order: 2;
display: flex;
}
.menu-items li {
list-style: none;
padding-left: 1.5rem;
font-size: 1.5rem;
}
.navbar a {
color: black;
text-decoration: none;
font-weight: 500;
transition: color 0.3s ease-in-out;
margin: 5px;
margin-top: 10px;
margin-left: 10px;
}
.navbar a:hover {
background-color: #21d4fd;
background-image: linear-gradient(305deg, #21d4fd 0%, #3821ff 100%);
}
@media (max-width: 768px) {
.navbar {
opacity: 0.95;
}
.navbar-container input[type="checkbox"],
.navbar-container .hamburger-lines {
display: block;
background-color: #21d4fd;
background-image: linear-gradient(270deg, #21d4fd 0%, #3821ff 100%);
}
.navbar-container {
display: block;
position: relative;
height: 64px;
}
.navbar-container input[type="checkbox"] {
position: absolute;
display: block;
height: 32px;
width: 30px;
top: 20px;
left: 20px;
z-index: 5;
opacity: 0;
cursor: pointer;
}
.navbar-container .hamburger-lines {
display: block;
height: 28px;
width: 35px;
position: absolute;
top: 20px;
left: 20px;
z-index: 2;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.navbar-container .hamburger-lines .line {
display: block;
height: 4px;
width: 100%;
border-radius: 10px;
background: #333;
}
.navbar-container .hamburger-lines .line1 {
transform-origin: 0% 0%;
transition: transform 0.3s ease-in-out;
}
.navbar-container .hamburger-lines .line2 {
transition: transform 0.2s ease-in-out;
}
.navbar-container .hamburger-lines .line3 {
transform-origin: 0% 100%;
transition: transform 0.3s ease-in-out;
}
.navbar .menu-items {
padding-top: 100px;
background: #fff;
height: 100vh;
max-width: 300px;
transform: translate(-150%);
display: flex;
flex-direction: column;
margin-left: -40px;
padding-left: 40px;
transition: transform 0.5s ease-in-out;
box-shadow: 5px 0px 10px 0px #aaa;
overflow: scroll;
}
.navbar .menu-items li {
margin-bottom: 1.8rem;
font-size: 1.1rem;
font-weight: 500;
}
.navbar-container input[type="checkbox"]:checked~.menu-items {
transform: translateX(0);
}
.navbar-container input[type="checkbox"]:checked~.hamburger-lines .line1 {
transform: rotate(45deg);
}
.navbar-container input[type="checkbox"]:checked~.hamburger-lines .line2 {
transform: scaleY(0);
}
.navbar-container input[type="checkbox"]:checked~.hamburger-lines .line3 {
transform: rotate(-45deg);
}
}
@media (max-width: 500px) {
.navbar-container input[type="checkbox"]:checked~.logo {
display: none;
}
}
</style>
</body>
</html>
Also see: Tab Triggers