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.
<section id="projects">
<h1>My Work</h1>
<p>A selection of some work</p>
<hr class="hr_white">
<h2>Photography</h2>
<div class="projects_grid" id="projects_photo">
<!-- Portfolio_item 01 -->
<a href="#" class="project-tile">
<img src="https://format-com-cld-res.cloudinary.com/image/private/s--Fhv0fDlR--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive,q_95/34895490286_d14559f485_o_w862z4.jpg"
alt="">
</a>
<!-- Portfolio_item 02 -->
<a href="#" class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--VXZx3cqy--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive,q_95/v1/0b5b7a598106c9053e772a159cc67b0c/IMG_0933.jpg"
alt=""></a>
<!-- Portfolio_item 03 -->
<a href="#" class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--JeRFkplE--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive,q_95/v1/f62f28121240912318ab4bc6a02f188a/PLLP9497.jpg"
alt=""></a>
<!-- Portfolio_item 04 -->
<a href="#" class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--iuBTpDpf--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive,q_95/v1/4dafb5f2eb084aa2ea3fdb4d40903d8e/PLLP9439.jpg"
alt=""></a>
<!-- Portfolio_item 05 -->
<a href="#" class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--DF0uh18G--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive,q_95/v1/afc8c520f833c85445bbbc58db563c7a/PLLP9389.jpg"
alt=""></a>
<!-- Portfolio_item 06 -->
<a href="#" class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--tGOibFIX--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive,q_95/v1/bc25c64dccd38a8626178fa40024f8ee/PLLP9169.jpg"
alt=""></a>
</div>
<hr class="hr_blue">
<hr class="hr_white">
<h2>Web Design</h2>
<p>- freeCodeCamp Responsive Web Design Projects -</p>
<div class="projects_grid" id="projects_web">
<!-- Portfolio_item 01 -->
<a href="https://codepen.io/studiolorenz/full/qBNeJzg" target="_blank" rel="noreferrer noopener"
class="project-tile">
<img src="https://format-com-cld-res.cloudinary.com/image/private/s--KFR2mF8J--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive.apng/v1/121971bbc3afb6a440878812f4f526e9/Screen_Shot_2020-12-09_at_3_29_10_PM.png"
alt="">
<p>Build a Technical Documentation page</p>
</a>
<!-- Portfolio_item 02 -->
<a href="https://codepen.io/studiolorenz/full/XWKxQNL" target="_blank" rel="noreferrer noopener"
class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--YG0gaP9g--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive.apng/v1/be303224081dd566ddb04609d416a2f0/Screen_Shot_2020-12-09_at_3_29_40_PM.png"
alt="">
<p>Build a Landing page</p>
</a>
<!-- Portfolio_item 03 -->
<a href="https://codepen.io/studiolorenz/full/GRZZxVb" target="_blank" rel="noreferrer noopener"
class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--bZDCPsAF--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive.apng/v1/c041426c7ee322bc76f3645be6c0e167/Screen_Shot_2020-12-09_at_3_30_00_PM.png"
alt="">
<p>Build a Survey form</p>
</a>
<!-- Portfolio_item 04 -->
<a href="https://codepen.io/studiolorenz/full/jOWvmML" target="_blank" rel="noreferrer noopener"
class="project-tile"><img
src="https://format-com-cld-res.cloudinary.com/image/private/s--vlgPN4Z6--/c_limit,g_center,h_1200,w_65535/fl_keep_iptc.progressive.apng/v1/645e66689857a2973a9f57c65e2f13a5/Screen_Shot_2020-12-09_at_3_30_29_PM.png"
alt="">
<p>Build a Tribute Page</p>
</a>
</div>
* {
font-family: helvetica;
}
h1 {
font-size: 2.5rem;
}
h2 {
font-size: 1.5rem;
}
a {
text-decoration: none;
}
#projects {
text-align: center;
margin: auto;
padding: 2rem 1.5rem;
/* height: 100vh; */
/* background-color: rgb(238, 111, 255); */
}
.projects_grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px,1fr));
margin-top: 1.5rem;
gap: 1.5rem;
}
.project-tile {
height: fit-content;
}
.project-tile p {
background-color: #333;
color: #f7f7f7;
padding: 20px 0;
border-radius: 0 0 5px 5px;
}
/* Trouble Area Below */
#projects_photo img {
display: block;
max-width: 100%;
/* min-height: and object-fit worked to stretch out the statue image proportionally; */
/* Why does not having a set min-height make it all wonky here? If you comment out min-height, it "fixes" it, but not really. How do I get all images in all grids to cover and fill the space proportionally? What am I doing wrong here? Thanks */
min-height: 100%;
object-fit: cover;
}
#projects_web img {
display: block;
max-width: 100%;
/* Why does HAVING a set min-height on this group make it all wonky? See how they're all uneven? If you comment out min-height, it "fixes" it, but not really. How do I get all images in all grids to cover and fill the space proportionally? What am I doing wrong here? Thanks */
/* min-height: 100%; */
object-fit: cover;
}
Also see: Tab Triggers