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.
<!-- <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script> -->
<!--
Hello Camper!
For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding!
- The freeCodeCamp Team
-->
<header class="primary" id="header">
<div class="header-content">
<a class="header-img-link" href="#">
<img class="header-img" src="https://www.augustiner-braeu.de/typo3conf/ext/mke_distribution/Resources/Public/images/Augustiner-Braeu-Muenchen.png" alt="Augustiner Bräu München Logo" id="header-img" />
</a>
<nav class="navbar" id="nav-bar">
<a class="nav-link" href="#features-anchor">Features</a>
<a class="nav-link" href="#products-anchor">Products</a>
<a class="nav-link" href="#contact-anchor">Contact</a>
</nav>
</div>
</header>
<main>
<section class="features-section" >
<a class="anchor" id="features-anchor"></a>
<ul class="features-list">
<li class="features-card">
<img class="feature-img" src="https://image.flaticon.com/icons/svg/126/126122.svg">
<div class="feature-description">
Available at any Späti.
</div>
</li>
<li class="features-card">
<img class="feature-img" src="https://image.flaticon.com/icons/svg/2770/2770337.svg">
<div class="feature-description">
For beer experts and novices alike.
</div>
</li>
</ul>
</section>
<section class="video-section">
<div class="iframe-wrapper">
<iframe width="560" height="315" src="https://www.youtube.com/embed/Df8IqKvUmk0" frameborder="0" allow="accelerometer; encrypted-media; gyroscope;" allowfullscreen id="video" alt="Video showing the Augustiner Biergarten in Munich."></iframe>
</div>
</section>
<section class="products-section">
<a class="anchor" id="products-anchor"></a>
<ul class="products-list">
<li class="product-card">
<h3 class="product-title">Lagerbier Helles</h3>
<img class="product-img" src="https://www.augustiner-braeu.de/fileadmin/_processed_/csm_Lexip_Augustiner_Helles_Glas_und_Flasche_freigestellt_Web__3767_print__67de554e85.png">
<p class="product-description">An especially mild, bubbly, long aged and, first and foremost, refreshing beer. Unique in its taste, a pleasure for any beer lover.</p>
<div class="product-card-footer">
<a class="btn" href="#">Learn more</a>
</div>
</li>
<li class="product-card">
<h3 class="product-title">Edelstoff</h3>
<img class="product-img" src="https://www.augustiner-braeu.de/fileadmin/_processed_/csm_Lexip_Augustiner_Edelstoff_Glas_und_Flasche_freigestellt_A_Web__3758_print__6862e46094.png">
<p class="product-description">A bright export beer, soft, bubbly and fresh at the same time. Brewed from only the finest ingredients. The pinnacle of old Bavarian brewing craft. A delight for any beer lover.</p>
<div class="product-card-footer">
<a class="btn" href="#">Learn more</a>
</div>
</li>
</ul>
</section>
<section class="contact-section">
<a class="anchor" id="contact-anchor"></a>
<h3 class="contact-form-heading">Product Newsletter</h3>
<p class="contact-form-callout">Stay up to date with all our new beers.</p>
<form class="contact-form" action="https://www.freecodecamp.org/email-submit" id="form">
<div class="input-group-inline">
<input type="email" name="email" placeholder="Enter your email" required="" id="email" />
<input class="btn" type="submit" name="submit" id="submit" value="Sign Up"/>
</div>
</form>
</section>
</main>
<footer class="secondary">
<p>Inspired by the beers and website of <a href="https://www.augustiner-braeu.de/unser-bier.html#" target="_blank">Augustiner Bräu München</a>.</p>
</footer>
* {
box-sizing: border-box;
font-family: 'Helvetica Neue', Arial, sans-serif;
}
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ol,
ul {
margin: 0;
padding: 0;
}
html {
color: black;
color: hsl(0, 0%, 20%);
background-color: white;
background-color: hsl(0, 0%, 100%);
font-size: 1rem;
line-height: 1.6;
}
::selection {
background-color: yellow;
background-color: hsla(80, 100%, 50%, 50%);
}
h1,
h2,
h3,
h4,
h5,
h6 {
line-height: 1.2;
margin-top: 1em;
}
h1 {
font-size: 2rem;
margin-top: 2em;
}
h2 {
font-size: 1.5rem;
margin-top: 2em;
}
h3 {
font-size: 1.25rem;
}
p,
ul,
ol,
pre {
margin-top: 0.75em;
}
li {
margin-top: 0.25em;
}
code {
display: inline;
font-size: 1.25em;
}
code,
pre {
background-color: lightgray;
background-color: hsl(204, 15%, 94%);
border-radius: 0.2em;
padding: 0.3em 0.4em;
font-family: monospace;
}
a {
color: blue;
color: hsl(210, 100%, 50%);
text-decoration: none;
}
a:hover {
/*border-bottom: 2px hsl(210, 100%, 55%) solid;*/
text-decoration: underline
}
a:visited {
color: magenta;
color: hsl(210, 100%, 40%);
}
ul,
ol {
list-style-position: outside;
padding-left: 1.75em;
}
ul > li,
ol > li {
padding-left: 0.5em;
}
ul > li {
list-style: disc;
}
hr {
border: none;
border-top: 1px solid lightgray;
border-top: 1px solid hsl(0, 0%, 90%);
margin: 50px 0;
}
button,
input,
fieldset,
select,
textarea {
padding: 0.2em 0.5em;
border: 1px solid lightgray;
border: 1px solid hsl(0, 0%, 90%);
border-radius: 2px;
background: none;
background-color: white;
background-color: hsl(0, 0%, 100%);
color: black;
color: hsl(0, 0%, 20%);
font-size: 1rem;
line-height: 1.6;
}
::placeholder {
color: lightgray;
color: hsl(0, 0%, 70%);
}
select {
display: inline-block;
-moz-appearance: none;
-webkit-appearance: none;
appearance: none;
background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='10px' width='10px'><polygon points='1,1 9,1 5,9' style='fill:hsl(0, 0%, 70%);' /></svg>");
background-origin: border-box;
background-repeat: no-repeat;
background-position: center right 5px;
padding-right: 1em;
}
button:hover,
[type=button]:hover,
[type=submit]:hover {
background: lightgray;
background: hsl(0, 0%, 90%);
}
button:active,
[type=button]:active,
[type=submit]:active {
background: gray;
background: hsl(0, 0%, 80%);
border-color: gray;
border-color: hsl(0, 0%, 80%);
}
img {
max-width: 100%;
height: auto;
}
/* BASE ****************************************************************************/
* {
color: darkblue;
color: hsl(204.5, 100%, 20%);
}
/* LAYOUT ****************************************************************************/
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1;
box-shadow: 0px 1px 5px hsla(204.5, 100%, 35.1%, 50%);
}
main {
width: 100%;
max-width: 80ch;
padding: 1em;
padding-top: 130px;
margin: 0 auto;
}
@media (min-width: 500px) {
main {
padding-top: 90px;
}
}
@media (min-width: 900px) {
main {
max-width: 1200px;
}
}
section {
margin-bottom: 2em;
}
.features-section {
max-width: 80ch;
margin-left: auto;
margin-right: auto;
}
.video-section {
max-width: 80ch;
/* Full width on small screens */
margin-left: -1em;
margin-right: -1em;
}
@media (min-width: 500px) {
.video-section {
margin-left: auto;
margin-right: auto;
}
}
.contact-section {
padding: 1em;
max-width: 80ch;
margin-left: auto;
margin-right: auto;
background-color: hsl(204.5, 50%, 95%);
border-radius: 2px;
}
footer {
padding: 1em;
text-align: center;
}
.anchor {
display: block;
position: relative;
top: -130px;
visibility: hidden;
}
@media (min-width: 700px) {
.anchor {
top: -75px;
}
}
/*MODULES*************************************************************************/
a {
color: hsl(204.5, 100%, 35.1%);
text-decoration: none;
}
a:hover {
text-decoration: underline
}
a:visited {
color: hsl(204.5, 50%, 50%);
}
.btn,
button,
input,
fieldset,
select,
textarea {
padding: 0.2em 0.5em;
border: 1px solid lightblue;
border: 1px solid hsl(204.5, 50%, 80%);
border-radius: 2px;
background: none;
background-color: white;
background-color: hsl(0, 0%, 100%);
font-size: 1rem;
line-height: 1.6;
color: black;
color: hsl(204.5, 100%, 20%);
}
::placeholder {
color: lightblue;
color: hsl(204.5, 30%, 70%);
}
.btn,
button,
[type=button],
[type=submit] {
background-color: darkblue;
background-color: hsl(204.5, 100%, 35.1%);
color: white;
}
.btn:hover,
button:hover,
[type=button]:hover,
[type=submit]:hover {
background-color: lightblue;
background-color: hsl(204.5, 50%, 50%);
text-decoration: none;
}
.btn:active,
button:active,
[type=button]:active,
[type=submit]:active {
background: blue;
background: hsl(204.5, 50%, 80%);
border-color: blue;
border-color: hsl(204.5, 50%, 80%);
text-decoration: none;
}
.btn:visited {
color: white;
}
.header-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding: 1em;
}
@media (min-width: 500px) {
.header-content {
flex-direction: row;
}
}
.header-img {
max-width: 100%;
height: auto;
margin-bottom: 0.5em;
}
@media (min-width: 500px) {
.header-img {
margin-bottom: 0;
}
}
.header-img-link {
display: contents;
}
.navbar {
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-around;
}
@media (min-width: 500px) {
.navbar {
justify-content: flex-end;
}
}
.nav-link {
min-width: 40px;
min-height: 40px;
line-height: 1;
padding: 12px 0;
color: hsl(204.5, 100%, 100%);
text-decoration: none;
text-align: center;
}
@media (min-width: 500px) {
.nav-link {
margin-left: 1em;
}
}
.nav-link:visited {
color: hsl(204.5, 100%, 100%);
}
.nav-link:hover {
color: hsl(204.5, 100%, 80%);
text-decoration: none;
}
.features-list {
padding: 0;
margin: 0;
list-style: none;
}
.features-card {
display: flex;
padding: 0;
margin-bottom: 1em;
}
.feature-img {
max-width: 50px;
height: auto;
}
.feature-description {
display: flex;
align-items: center;
margin-left: 1em;
}
.iframe-wrapper {
position: relative;
padding-bottom: 56.25%; /*16:9 ratio*/
height: 0;
}
.iframe-wrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.products-list {
display: flex;
flex-direction: column;
padding: 0;
margin: 0;
list-style: none;
}
@media (min-width: 500px) {
.products-list {
flex-direction: row;
}
}
.product-card {
display: flex;
flex-direction: column;
padding: 0;
margin-bottom: 1em;
border: 1px solid hsl(204.5, 50%, 95%);
border-radius: 2px;
}
@media (min-width: 500px) {
.product-card {
margin: 1em;
flex-basis: 300px;
flex-shrink: 1;
flex-grow: 1;
;
}
}
.product-title {
padding: 1em;
margin: 0;
background-color: hsl(204.5, 50%, 95%);
text-align: center;
font-weight: 700;
font-size: larger;
}
.product-img {
display: block;
margin: 0 auto;
max-width: 100%;
height: auto;
max-height: 50vh;
}
.product-description {
padding: 0 1em;
margin: 0.5em 0;
flex-grow: 1;
}
.product-card-footer {
padding: 1em;
background-color: hsl(204.5, 50%, 95%);
}
.product-card-footer > .btn {
display: block;
margin: 0 auto;
width: max-content;
}
.contact-form-heading {
margin: 0;
}
.contact-form-callout {
margin: 0.5em 0;
}
.input-group-inline {
display: flex;
}
.input-group-inline > input {
margin-left: 0.5em;
}
.input-group-inline > input:first-of-type {
margin-left: 0;
}
.input-group-inline > input[type="email"]{
min-width: 100px;
flex-basis: 100px;
flex-grow: 1;
flex-shrink: 1;
}
/*STATE*************************************************************************/
::selection {
background-color: lightblue;
background-color: hsl(204.5, 100%, 80%);
background-color: hsla(204.5, 100%, 80%, 80%);
}
/* THEME *************************************************************************/
.primary {
background-color: darkblue;
background-color: hsl(204.5, 100%, 35.1%);
color: white;
}
.secondary {
background-color: lightblue;
background-color: hsl(204.5, 50%, 95%);
}
// !! IMPORTANT README:
// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place.
/***********
INSTRUCTIONS:
- Select the project you would
like to complete from the dropdown
menu.
- Click the "RUN TESTS" button to
run the tests against the blank
pen.
- Click the "TESTS" button to see
the individual test cases.
(should all be failing at first)
- Start coding! As you fulfill each
test case, you will see them go
from red to green.
- As you start to build out your
project, when tests are failing,
you should get helpful errors
along the way!
************/
// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!
// Once you have read the above messages, you can delete all comments.
Also see: Tab Triggers