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.
<header>
<a href="index.html"><img src="https://assets.codepen.io/5257275/ttc_logo.png" alt="logo"/></a>
<nav>
<ul>
<li><a class="activePage" href="index.html">Home</a></li>|
<li><a href="#about">About</a></li>|
<li><a href="#portfolio">Portfolio</a></li>|
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<body>
<section id="welcome" class="clearFix">
<h1>Designing Your World</h1>
<h2>One pixel at a time.</h2>
</section>
<main>
<section id="about">
<h2>About Us</h2>
<article class="col1">
<p>Two Trees Creative is a full-service graphic design agency based in Ventura, CA. Our goal is to provide elegant work and unsurpassed customer service to our clients in every way.</p>
<h3>Meet Our Team of Creatives</h3>
<p>Collectively we have over 15 years experience in the graphic design industry, and our services include brand identity development, business cards, brochures, flyers, catalogs, and more. Thank you for considering us for your next project, and we hope to hear from you soon.</p>
</article>
<figure class="col2">
<img src="https://assets.codepen.io/5257275/alex_morrales.jpg" width="155" height="157" alt="Alex Morrales"/>
<img src="https://assets.codepen.io/5257275/david_kim.jpg" width="155" height="157" alt="David Kim"/>
<img src="https://assets.codepen.io/5257275/jenny_tabers.jpg" width="155" height="157" alt="Jenny Tabers"/>
<img src="https://assets.codepen.io/5257275/joey_barrett.jpg" width="155" height="157" alt="Joey Barrett"/>
<img src="https://assets.codepen.io/5257275/melinda_lee.jpg" width="155" height="157" alt="Melinda Lee"/>
<img src="https://assets.codepen.io/5257275/rachel_dotson.jpg" width="155" height="157" alt="Rachel Dotson"/>
</figure>
</section>
<section id="portfolio" class="clearFix">
<h2>Portfolio</h2>
<figure>
<button type="submit" class="btn" id="topLeft" name="scroll" value="scroll">
<img src="https://assets.codepen.io/5257275/musebtn.jpg" alt="Scroll Button" width="63">
</button>
<img src="https://assets.codepen.io/5257275/_0000_akridge_bcard.jpg" width="235" height="135" alt="Ackridge"/>
<img src="https://assets.codepen.io/5257275/_0001_balloon_races.jpg" width="235" height="135" alt="Balloon Races"/>
<img src="https://assets.codepen.io/5257275/_0002_seminar_flyer.jpg" width="235" height="135" alt="Seminar Flyer"/>
<img src="https://assets.codepen.io/5257275/_0003_eyedr_billboard.jpg" width="235" height="135" alt="Eye Dr Billboard"/>
<button type="submit" class="btn" id="topRight" name="scroll" value="scroll">
<img src="https://assets.codepen.io/5257275/musebtn.jpg" alt="Scroll Button" width="63">
</button>
<img src="https://assets.codepen.io/5257275/_0004_nerdcamp_logo.jpg" width="235" height="135" alt="NerdCamp Logo"/>
<button type="submit" class="btn" id="bottomLeft" name="scroll" value="scroll">
<img src="https://assets.codepen.io/5257275/musebtn.jpg" alt="Scroll Button" width="63">
</button>
<img src="https://assets.codepen.io/5257275/_0005_rockout_festival.jpg" width="235" height="135" alt="Rockout Festival"/>
<img src="https://assets.codepen.io/5257275/_0006_history_of_flight.jpg" width="235" height="135" alt="History of Flight"/>
<img src="https://assets.codepen.io/5257275/_0007_welder_poster.jpg" width="235" height="135" alt="Welder Poster"/>
<button type="submit" class="btn" id="bottomRight" name="scroll" value="scroll">
<img src="https://assets.codepen.io/5257275/musebtn.jpg" alt="Scroll Button" width="63">
</button>
</figure>
</section>
<section id="contact">
<figure class="col1">
<img src="https://assets.codepen.io/5257275/map.png" width="575" height="550" alt="Map"/>
</figure>
<section class="col2">
<h2>Contact Us</h2>
<form method="post" action="http://webdevbasics.net/scripts/demo.php">
<input type="email" id="email" name="emailaddress" placeholder="Your Email Address">
<textarea name="subject" id="subject" placeholder="Subject of Your Message"></textarea>
<textarea name="message" id="message" placeholder="Your message goes here..."></textarea>
<button id="send" type="submit">
SEND
<img src="https://assets.codepen.io/5257275/sendarrow.png" id="arrow" alt="arrow"/>
</button>
</form>
</section>
</section>
</main>
</body>
<footer class="clearFix">
<a href="index.html" target="top"><img src="https://assets.codepen.io/5257275/musebtn.jpg" id="normal" alt="Back to Top"/>
<p>Back to Top</p></a>
<img src="https://assets.codepen.io/5257275/social_icons.png" id="socialIcons" alt="Social Icons"/>
</footer>
</html>
@charset "utf-8";
@font-face {
font-family: 'Effra', sans-serif;
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Effra Bold', sans-serif;
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'kepler-std-display', serif;
font-weight: 400;
font-style: italic;
}
header, nav, main, address, footer {
display: block;
}
header {
text-align: center;
background-color: #EBEBEB;
}
#logo {
filter: brightness(75%) saturate(75%);
}
nav {
padding-top: 5px;
margin-bottom: -30px;
font-size: 18px;
color: #5B866B
}
nav ul {
list-style: none;
}
nav ul li {
display: inline-block;
}
nav ul li a {
text-decoration: none;
color: #5B866B;
text-transform: uppercase;
margin: 0 25px;
position: relative;
}
nav ul li a:hover {
color: #fff;
background: rgba(185, 140, 72, 0.8);
padding: 6px;
}
.activePage {
color: #fff;
background: rgb(185, 140, 72);
padding: 6px;
}
body {
width: 1280px;
margin: 0 auto;
background-color: #EBEBEB;
font-family: Effra;
}
#welcome {
background: url("https://assets.codepen.io/5257275/twotrees.jpg") rgba(45, 62, 163, 0.8);
background-blend-mode: exclusion;
background-size: cover;
height: 720px;
color: #fff;
text-align: center;
}
h1 {
padding-top: 225px;
font-size: 64px;
font-family: 'Effra Bold', sans-serif;
text-transform: uppercase;
}
#welcome h2 {
font-size: 48px;
font-family: 'kepler-std-display';
color: #fff;
margin: -50px;
text-transform: none;
}
.col1 {
float: left;
padding-left: 100px;
padding-right: 25px;
width: 515px;
}
.col2 {
float: right;
width: 515px;
padding-right: 100px;
padding-left: 25px;
}
.clearFix {
clear: both;
max-width: 1280px;
}
h2 {
color: #524741;
font-size: 48px;
font-family: 'Effra Bold', sans-serif;
text-transform: uppercase;
}
h3 {
color: #86765C;
font-size: 36px;
font-family: 'Effra Bold', sans-serif;
}
p {
font-family: 'Effra', sans-serif;
font-size: 18px;
}
#about h2 {
text-align: center;
}
#about figure {
margin-left: 50px;
margin-top: -310px;
padding-bottom: 50px;
}
#about img {
box-shadow: 3px 3px #D3D3D3;
padding: 6px;
}
#portfolio {
background-color: #5B866B;
padding: 50px 0;
position: relative;
text-align: center;
}
#portfolio h2 {
color: #fff;
margin-top: -5px;
}
#portfolio figure {
width: 1000px;
margin: auto;
position: relative;
}
#portfolio img {
padding: 5px;
}
.btn {
border: none;
display: flex;
position: absolute;
border-radius: 50px;
cursor: pointer;
background-color: #B98C48;
overflow: hidden;
clip-path: circle(35%);
z-index: 4;
top: 1px;
}
#topLeft {
transform: rotate(-90deg);
margin-top: 35px;
margin-left: -40px;
}
#bottomLeft {
transform: rotate(-90deg);
margin-top: 185px;
margin-left: -40px;
}
#topRight {
transform: rotate(90deg);
margin-top: 35px;
margin-left: 950px;
}
#bottomRight {
transform: rotate(90deg);
margin-top: 185px;
margin-left: 950px;
}
#contact h2 {
margin-left: 150px;
margin-top: -10px;
}
#contact img {
margin-top: -1em;
position: absolute;
margin-left: -3em;
}
form {
padding-left: 25px;
}
input, textarea {
margin-top:10px;
display: block;
font-family: Effra, sans-serif;
font-size: 18px;
padding: 10px 0 10px 10px;
background-color: rgba(175, 175, 175, .45);
}
textarea {
min-width: 500px;
}
#email {
min-width: 498px;
}
#message {
padding-bottom: 150px;
}
#send {
margin-left: 380px;
margin-top: 30px;
padding-right: 28px;
padding-top: 6px;
font-family: 'Effra', sans-serif;
font-size: 24px;
background-color: #5B866B;
color: #fff;
position: relative;
clear: both;
width: 130px;
height: 60px;
line-height: 24px;
cursor: pointer;
border-radius: 5px;
white-space: nowrap;
}
#arrow {
padding-left: 76px;
padding-top: 20px;
}
footer {
height: 80px;
padding-top: 80px;
margin: auto;
}
#normal {
float: right;
margin-right: 80px;
}
footer p {
float: right;
padding: 20px 10px 0 0;
font-family: 'Effra', sans-serif;
font-size: 14px;
color: #000;
}
#socialIcons {
margin-left: 93px;
}
Also see: Tab Triggers