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.
<body>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<header id='header'>
<div id='top-header'>
<div id='social-media'>
<p>Follow us:</p>
<ul id='social-list'>
<li><i class="fa fa-facebook"></i>
</li>
<li><i class="fa fa-twitter"></i>
</li>
</ul>
</div>
<div id='logo'>
<img src='https://cdn4.vectorstock.com/i/thumb-large/39/53/woman-with-grapes-and-wine-vector-20273953.jpg' alt='logo' id='header-img'>
</div>
<div id='cart'>
<i class="fa fa-shopping-cart fa-lg"></i><span id='cart-count'> (0)</span>
<p id='cart-text'>Your cart</p>
</div>
</div>
<div id='bottom-header'>
<nav id='nav-bar'>
<ul id='nav-link-list'>
<li><a class='nav-link' href='#our-prdts'>Our products</a></li>
<li><a class='nav-link' href='#history'>About us</a></li>
<li><a class='nav-link' href='#news'>News</a></li>
</ul>
</nav>
<div id='wine-intro'>
<h1>Cavalon Bliss</h1>
<p>Hand crafted wine grown with love & respect for the land</p>
</div>
</div>
</header>
<section id='our-prdts'>
<h2>OUR WINE COLLECTION</h2>
<div id='products'>
<div class='wine-collection'>
<h3 class='collectn-title'>TOP RATED</h3>
<p class='collectn-description'>Considered to be the best or among the best</p>
<ul class='collectn-list'>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608315255-tc-chablis-1608315237.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'> Samuel Billaud Chablis Premier Cru Montee de Tonnerre</h4>
<p class='wine-price'>$57.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608307678-tc-terrebrulee-1608307663.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'>Tania et Vincent Careme Terre Brulee Chenin Blanc</h4>
<p class='wine-price'>$15.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608308072-tc-sancerre-1608308040.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'> Château de Sancerre</h4>
<p class='wine-price'>$27.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
</ul>
</div>
<div class='wine-collection'>
<h3 class='collectn-title'>FEATURED</h3>
<p class='collectn-description'>Featured products are a great way to promote specific items on your website.<br> </p>
<ul class='collectn-list'>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608315255-tc-chablis-1608315237.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'> Samuel Billaud Chablis Premier Cru Montee de Tonnerre</h4>
<p class='wine-price'>$57.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608307678-tc-terrebrulee-1608307663.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'>Tania et Vincent Careme Terre Brulee Chenin Blanc</h4>
<p class='wine-price'>$15.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608308072-tc-sancerre-1608308040.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'> Château de Sancerre</h4>
<p class='wine-price'>$27.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
</ul>
</div>
<div class='wine-collection'>
<h3 class='collectn-title'>STAFF PICKS</h3>
<p class='collectn-description'>The product indicated was selected by one or more of the staffers at the shop as their favorite or one of their favorites. </p>
<ul class='collectn-list'>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608315255-tc-chablis-1608315237.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'> Samuel Billaud Chablis Premier Cru Montee de Tonnerre</h4>
<p class='wine-price'>$57.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608307678-tc-terrebrulee-1608307663.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'>Tania et Vincent Careme Terre Brulee Chenin Blanc</h4>
<p class='wine-price'>$15.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
<li class='collectn-item'>
<img src='https://hips.hearstapps.com/vader-prod.s3.amazonaws.com/1608308072-tc-sancerre-1608308040.jpg?crop=1xw:1xh;center,top&resize=768:*' alt='wine pic' class='wine-pic'>
<div class='wine-meta-data'>
<h4 class='wine-name'> Château de Sancerre</h4>
<p class='wine-price'>$27.99</p>
<button class='cart-adder'>Add to cart</button>
</div>
</li>
</ul>
</div>
</div>
<h3 id='wine-vid-title'>The Wine Making Process</h3>
<div id='wine-vid'>
<iframe width="560" height="315" src="https://www.youtube.com/embed/eQNSD8GAOtE" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen id="video"></iframe>
<div id='wine-quotes'>
<p class='quote'>“Anyone who tries to make you believe that he knows all about wines is obviously a fake.”<i><br>― Leon Adams, The Commonsense Book of Wine</i><br><br></p>
<p class='quote'>“Age is just a number. It’s totally irrelevant unless, of course, you happen to be a bottle of wine.”<i><br>― Joan Collins</i><br><br></p>
<p class='quote'>“The discovery of a wine is of greater moment than the discovery of a constellation. The universe is too full of stars.”<i><br>― Benjamin Franklin, circa 1700s</i><br><br></p>
</div>
</div>
</section>
<section id='sectn3'>
<div id='history'>
<div id='history-card'>
<h2>The Foundation of Our Wine</h2>
<p>The first white wine can be traced all the way back to the antiquities approximately 7500 years ago from wine located in what’s now Iran. Unfortunately, even though we’ve located this significant find, it does little to tell us just how long wine has been produced, which, in all fairness could centuries prior.</p>
<p> What we do know is that wine was very present throughout much of the Middle East. In third millennium BC, the tablets of Hattusa can found talking much about white wine.</p>
<p> Wine was discovered about 6,000 years ago in either Mesopotamia, Palestine/Israel, or what is now called Georgia. It originally fermented by accident when native yeasts stuck to grapes stored in containers turned the sugars in the grapes into alcohol. The ancient Egyptians refined the sciences of both grape growing and winemaking and included wine in burial crypts for consumption in the afterlife. The Greeks spread winemaking throughout the Mediterranean, and the Romans turned it into a big business. The Spanish exploration of the New World brought winemaking to the Americas, while other Europeans took it to Australia, New Zealand, and South Africa.
</p>
</div>
</div>
<div id='news'>
<h2>VINEYARD EVENTS</h2>
<p class='color-text'>Ut enim ad minim veniam quis nostrud</p>
<div id='events'>
<ul id='event-list'>
<li class='event-item'>
<h3>TOUR</h3>
<i class="fa fa-calendar" aria-hidden="true"> April 23 2025</i>
<i class="fa fa-clock-o"> 4:00pm</i>
<i class="fa fa-map-marker" aria-hidden="true"> Leeuwin Estate Winery, Australia</i>
</li>
<li class='event-item'>
<h3>TASTE FESTIVAL</h3>
<i class="fa fa-calendar" aria-hidden="true"> April 23 2025</i>
<i class="fa fa-clock-o"> 4:00pm</i>
<i class="fa fa-map-marker" aria-hidden="true"> Holden Manz Winery, South Africa</i>
</li>
<li class='event-item'>
<h3>HARVEST HANGOUT</h3>
<i class="fa fa-calendar" aria-hidden="true"> April 23 2025</i>
<i class="fa fa-clock-o"> 4:00pm</i>
<i class="fa fa-map-marker" aria-hidden="true"> Marques de Riscal, Spain</i>
</li>
</ul>
<img id='event-img' alt='events we carry out' src='https://www.austynelizabeth.com/wp-content/uploads/2016/07/19-5223995-post/cass-winery-wedding-paso-robles-67-1024x682(pp_w768_h511).jpg'>
</div>
<div id='news-letter'>
<h2>NEWSLETTER</h2>
<p class='color-text'>Sign up to receive latest news on our wines</p>
<form id="form" target='_blank' action=' https://www.freecodecamp.com/email-submit' method="POST">
<input type='email' id='email' name='email' placeholder='Type your email here...'><input type='submit' value='Submit' id="submit">
</form>
</div>
</div>
</section>
<footer id='sectn2'>
<a href='#logo'><img src='https://cdn4.vectorstock.com/i/thumb-large/39/53/woman-with-grapes-and-wine-vector-20273953.jpg' alt='footer logo' id='footer-logo'></a>
<div id='footer-contact'>
<p><a href='#history'>Story about us</a></p>
<p><a href='#news'>Our latest blog posts</a></p>
<p><a href='#products'>Purchase our products</a></p>
<p><a href='news-letter'>Keep in touch</a></p>
</div>
<div id='footer-news'>
<p class='date'>September 11, 2019</p>
<p>Our Best Aperitifs</p>
<p class='date'>September 11, 2019</p>
<p>Amazing Recipes</p>
</div>
</footer>
</body>
html {
scroll-behavior: smooth;
}
body {
margin: 0;
padding: 0;
}
ul li {
list-style-type: none;
}
#wine-intro {
margin: 120px 0 auto 600px;
}
#wine-intro h1 {
font-family: "Great Vibes", georgia;
color: white;
font-size: 80px;
margin-top: 80px;
}
#wine-intro p {
font-family: "Sofia", georgia;
font-size: 30px;
color: white;
font-weight: bold;
margin-top: 0;
}
button {
background-color: #ffab73;
border: 1px solid #e48257;
outline: none;
border-radius: 25px;
}
button:hover,
[type="submit"]:hover {
background-color: #e48257;
cursor: pointer;
}
#top-header {
background-color: white;
display: flex;
justify-content: space-around;
height: 55px;
margin: 0;
padding: 0;
}
.fa-facebook {
width: 18px;
height: 18px;
cursor: pointer;
padding: auto 2px;
margin: auto 2px;
}
.fa-twitter {
cursor: pointer;
padding-top: 0.7px;
}
.fa-facebook:hover,
.fa-twitter:hover {
color: #e48257;
}
#social-media {
display: flex;
}
#header-img {
width: 80px;
height: 70px;
}
.color-text {
color: #d97642;
}
ul#social-list {
display: flex;
padding-left: 2px;
}
#cart {
line-height: 3px;
margin: 10px 2px 0 0;
}
.fa-shopping-cart {
margin: 4px auto 0px auto;
}
#cart-text {
font-size: 15px;
}
#bottom-header {
margin: 0;
padding: 0;
background-image: url("https://s1.1zoom.me/big0/446/Fields_Sky_Grapes_Wine_501432.jpg");
background-size: cover;
height: 700px;
background-repeat: no-repeat;
}
#nav-link-list {
display: flex;
margin-left: 700px;
}
.nav-link {
color: white;
font-size: 16px;
padding: 0px 20px 5px 7px;
text-decoration: none;
border: 1px solid white;
}
.nav-link:hover {
font-size: 20px;
}
h2,
h3,
h4 {
font-family: "Shippori Mincho B1", serif;
}
#our-prdts h2 {
color: #cc561e;
padding: 20px 5px;
box-shadow: 2px 7px 4px 2px #ffd384;
font-family: "Shippori Mincho B1", serif;
font-weight: bold;
font-size: 25px;
}
#our-prdts h3 {
color: #bb460d;
font-size: 20px;
}
.wine-collection {
text-align: center;
}
#products,
li.collectn-item {
display: flex;
flex-direction: row;
}
.wine-pic {
height: 90px;
}
.wine-name {
font-size: 15px;
}
#wine-vid {
display: flex;
background-color: #fff9b0;
}
#wine-vid-title {
border: 1px solid #fff;
box-shadow: 1px 5px 3px 2px #fff9b0;
}
#wine-quotes {
line-height: 26px;
margin: 0 10px;
}
.quote {
padding: 0px;
margin: 0;
}
#history {
height: 300px;
background-color: black;
background-image: url(https://ak.picdn.net/shutterstock/videos/948418/thumb/4.jpg);
background-repeat: no-repeat;
background-size: 334px 260px;
}
#history-card {
padding: 20px;
margin: 0 120px 0 400px;
height: 320px;
background-color: #eedad1;
overflow: scroll;
}
#news {
margin-top: 100px;
text-align: center;
}
#news p.color-text {
font-size: 20px;
margin-bottom: 60px;
line-height: 0;
}
#events {
display: flex;
}
.event-item {
border: 1px solid #d97642;
}
#event-img {
height: 500px;
}
/*===============
NEWSLETTER
*===============*/
[type="email"] {
font-size: 20px;
font-style: italic;
margin-top: 50px;
width: 420px;
height: 40px;
}
[type="submit"] {
margin: 0px auto 10px auto;
background-color: #ffab73;
border: 1px solid #e48257;
outline: none;
font-size: 18px;
height: 46px;
width: 90px;
border-radius: 1px 5px 5px 1px;
}
[type="submit"]:hover {
width: 100px;
height: 52px;
}
form {
margin-bottom: 40px;
}
/*===============
FOOTER
*===============*/
footer {
display: flex;
justify-content: space-between;
margin: 120px 10px 0 0;
padding: 20px;
border: 1px solid #ffab73;
box-shadow: 1px -3px 3px 1px #ffcb91;
}
footer img {
width: 200px;
height: 190px;
}
.date {
color: #e48257;
}
footer a {
font-style: italic;
font-size: 18px;
text-decoration: none;
color: #000;
}
footer a:hover {
color: #e48257;
}
/* MEDIA QUERIES */
@media (max-width: 1120px) {
#nav-link-list {
margin-left: 550px;
}
}
@media (max-width: 940px) {
#nav-link-list {
margin-left: 500px;
}
.nav-link {
font-size: 15px;
padding: 0px 15px 5px 7px;
}
.nav-link:hover {
font-size: 18px;
}
#event-img {
width: 600px;
height: 400px;
}
#wine-intro {
margin: 120px 0 auto 400px;
}
#wine-intro h1 {
font-size: 60px;
}
#wine-intro p {
font-size: 25px;
}
}
@media (max-width: 890px) {
#nav-link-list {
margin-left: 400px;
}
.nav-link {
font-size: 14px;
padding: 0px 13px 5px 7px;
}
.nav-link:hover {
font-size: 17px;
}
#products {
display: inline-block;
}
.collectn-list {
display: flex;
padding: 2px;
}
.wine-pic {
height: 100px;
}
.wine-name {
font-size: 15px;
}
#event-img {
width: 500px;
}
}
@media (max-width: 870px) {
#bottom-header {
height: 500px;
}
#nav-link-list {
margin-left: 340px;
}
.nav-link {
font-size: 14px;
padding: 0px 13px 5px 7px;
}
.collectn-list {
display: block;
justify-content: center;
margin: auto 110px;
}
.wine-collection {
margin: auto auto 40px auto;
}
.collectn-item {
margin: 50px auto;
}
.wine-pic {
height: 120px;
}
#history-card {
margin: 0 80px 0 400px;
}
footer img {
width: 140px;
height: 150px;
}
}
@media (max-width: 730px) {
#nav-link-list {
margin-left: 200px;
}
#wine-vid {
display: inline-block;
}
#history-card {
margin: 0 50px 0 300px;
}
#history-card h2 {
font-size: 18px;
}
footer {
padding: 0rem;
}
#event-img {
height: 300px;
}
footer img {
width: 150px;
height: 140px;
}
.date {
color: #e48257;
font-size: 13px;
}
footer a,
#footer-news p {
font-size: 15px;
}
}
@media (max-width: 640px) {
#nav-link-list {
margin-left: 200px;
}
iframe {
width: 440px;
margin: 0 30px;
}
#history-card {
margin: 0 40px 0 250px;
}
#history-card h2 {
font-size: 18px;
}
[type="email"] {
font-size: 18px;
width: 400px;
height: 36px;
}
[type="submit"] {
height: 43px;
width: 80px;
}
[type="submit"]:hover {
width: 90px;
height: 45px;
}
#events {
display: flex;
flex-direction: column-reverse;
}
#event-list {
margin: 0 60px 50px 30px;
}
#event-img {
margin-bottom: 0;
width: 100%;
height: 380px;
}
#wine-intro {
margin: 10px 0 auto 340px;
}
#wine-intro h1 {
margin-top: 120px;
font-size: 50px;
}
#wine-intro p {
font-size: 20px;
}
}
@media (max-width: 550px) {
#nav-link-list {
margin-left: 85px;
}
.collectn-list {
margin: auto 20px;
}
iframe {
width: 340px;
margin: 0 30px;
}
#history {
height: 500px;
}
#history-card {
position: relative;
margin: 0;
width: 80%;
top: 55%;
}
#history-card h2 {
font-size: 18px;
}
#news {
margin-top: 160px;
}
[type="email"] {
font-size: 14px;
font-style: italic;
margin-top: 50px;
width: 290px;
height: 30px;
}
[type="submit"] {
font-size: 16px;
height: 37px;
width: 70px;
}
[type="submit"]:hover {
width: 80px;
height: 40px;
}
footer {
padding: 0px;
}
footer img {
width: 120px;
height: 120px;
}
#date {
color: #e48257;
}
#wine-intro {
margin: 0px 0 auto 240px;
}
#wine-intro h1 {
margin-top: 40px;
font-size: 35px;
}
#wine-intro p {
font-size: 20px;
}
}
@media (max-width: 440px) {
#nav-link-list {
margin-left: 50px;
}
.nav-link {
font-size: 15px;
padding: 0px 8px 5px 7px;
}
iframe {
width: 330px;
margin: 0 10px;
}
[type="email"] {
font-size: 14px;
width: 200px;
height: 30px;
}
[type="submit"] {
font-size: 14px;
height: 36px;
width: 60px;
}
[type="submit"]:hover {
width: 70px;
height: 42px;
}
footer {
display: flex;
justify-content: space-between;
padding: 0px;
}
footer img {
width: 100px;
height: 120px;
}
#date,
#footer-news p {
font-size: 12px;
}
footer a {
font-size: 13px;
}
#event-img {
height: 330px;
}
#wine-intro {
margin: 0px 0 auto 140px;
}
#wine-intro h1 {
margin-top: 30px;
font-size: 30px;
}
#wine-intro p {
font-size: 18px;
}
}
@media (max-width: 340px) {
#nav-link-list {
margin-left: 10px;
}
.nav-link {
font-size: 13px;
padding: 0px 8px 5px 7px;
}
.nav-link:hover {
font-size: 15px;
}
iframe {
width: 230px;
height: 230px;
margin: 0 30px;
}
.collectn-list {
margin: auto 5px;
}
#event-img {
height: 300px;
}
#news p.color-text {
font-size: 16px;
}
footer img {
width: 100px;
height: 100px;
}
#wine-intro {
margin: 10px 0 auto 140px;
}
#wine-intro h1 {
margin-top: 30px;
font-size: 26px;
}
#wine-intro p {
font-size: 16px;
}
}
Also see: Tab Triggers