Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
  <div class="viewport__container">
    <!-- start .viewport__container -->

    <div class="content__container bg__dark-brown">
      <!-- start header.content__container-->
      <header id="header" class="header__main">
        <div class="logo">
          <a href="/"><img src="https://i.ibb.co/FxG8Zrk/coffee.png" id="header-img" alt="coffee"></a></a>Crazy
          about coffee
        </div>
        <nav id="nav-bar" class="header__navigation">
          <ul>
            <li><a class="nav-link" href="#intro">Intro</a></li>
            <li><a class="nav-link" href="#info">info</a></li>
            <li><a class="nav-link" href="#try">try</a></li>
          </ul>
        </nav>
      </header>
    </div>
    <!-- end header .content__container-->

    <div class="content__container bg__light">
      <div class="intro" id="intro">
        <div class="intro__image">
          <img src="https://source.unsplash.com/zlwDJoKTuA8/800x600" alt="Coffee" height="auto" max-width="100%" />
        </div>
        <div class="intro__heading-and-link">
          <h1>Welcome to Crazy about Coffee!</h1>
          <a href="#try">Free coffee!!</a>
        </div>
      </div>
    </div>
    <div class="content__container bg__tan">
      <main>
        <section>
          <h2 id="info">Find out more</h2>
          <iframe id="video" width="400" height="300" src="https://www.youtube-nocookie.com/embed/N8meCjVsJWI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
        </section>
        <section>
          <h2 id="try">Sample our coffee</h2>
          <form action="https://www.freecodecamp.com/email-submit" id="form">
            <input type="email" id="email" name="email" placeholder="Please enter your email address" />
            <input type="submit" id="submit" value="Get your coffee!!!" />
          </form>
        </section>
      </main>
    </div>

    <div class="content__container bg__dark-brown">
      <footer>
        <p>Built by <a href="https://michaelgainford.co.uk">Michael</a></p>
      </footer>
    </div>
  </div>
  <!-- end .viewport__container -->
</body>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Staatliches&display=swap");
:root {
  --ff: Staatliches, sans-serif;
  --clr1: #402218;
  --clr2: #865439;
  --clr3: #c68b59;
  --clr3-trans: rgba(198, 139, 89, 0.2);
  --clr4: #d7b19d;
  --clr-black-transparent: rgba(0, 0, 0, 0.8);
  --clr-white: #fff;
}

html {
  scroll-behavior: smooth;
}

* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  font-family: var(--ff);
}

header,
main,
section,
footer,
.intro {
  max-width: 1200px;
  padding: 2rem 0;
  width: 100%;
}

@media (min-width: 600px) {
  header {
    padding: 2rem 0;
  }
}
header {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
}
header > * {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 50%;
}

main {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  border-bottom: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: start;
  -ms-flex-pack: start;
  justify-content: flex-start;
  padding-bottom: 0;
  max-width: 3000px;
  width: 100%;
}
main section {
  border-bottom: 0;
}
main section:last-of-type {
  padding-bottom: 6rem;
}

section {
  padding: 6rem 0;
}

footer {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  min-height: 3rem;
  padding: 1rem 0;
}

/* custom classes */
.bg__light {
  background-color: var(--clr4);
}

.bg__tan {
  background-color: var(--clr3);
}

.bg__dark-brown {
  background-color: var(--clr1);
}

/* handling full width containers */
.viewport__container {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}
.viewport__container > * {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  width: 100%;
}

.content__container {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  width: 100%;
}

/* logo */
.logo {
  color: var(--clr3);
  font-size: 1.2rem;
}
@media (min-width: 600px) {
  .logo {
    font-size: 1.6rem;
  }
}
@media (min-width: 900px) {
  .logo {
    font-size: 2rem;
  }
}
.logo a {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  color: var(--clr3);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  text-decoration: none;
  letter-spacing: 0.04rem;
}
.logo a #header-img {
  color: var(--clr4);
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

/* nav */
.header__navigation {
  -webkit-box-pack: end;
  -ms-flex-pack: end;
  justify-content: flex-end;
}
.header__navigation ul {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  height: 100%;
}
.header__navigation ul li {
  list-style: none;
}
.header__navigation ul li a {
  border-bottom: 2px solid transparent;
  color: var(--clr4);
  padding: 0 1rem;
  text-decoration: none;
  -webkit-transition: -webkit-text-decoration 1s;
  transition: -webkit-text-decoration 1s;
  transition: text-decoration 1s;
  transition: text-decoration 1s, -webkit-text-decoration 1s;
  font-size: 1.2rem;
}
@media (min-width: 600px) {
  .header__navigation ul li a {
    font-size: 1.6rem;
  }
}
@media (min-width: 900px) {
  .header__navigation ul li a {
    font-size: 2rem;
    padding: 0 2rem;
  }
}
.header__navigation ul li a:hover {
  text-decoration: underline;
}

/* intro section */
.content__container .intro {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  padding: 4.8rem 2rem;
}
.content__container .intro > * {
  height: 100%;
}
@media (min-width: 600px) {
  .content__container .intro {
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: start;
    display: grid;
    grid-template-columns: 60% 40%;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    padding: 6.4rem 0.6rem;
  }
}
@media (min-width: 900px) {
  .content__container .intro {
    grid-template-columns: 50% 50%;
  }
}
.content__container .intro .intro__image img {
  border: 10px solid var(--clr2);
  height: auto;
  max-width: 100%;
  margin-bottom: 1.4rem;
}
@media (min-width: 600px) {
  .content__container .intro .intro__image img {
    border-width: 15px;
    margin-bottom: 0;
  }
}
@media (min-width: 900px) {
  .content__container .intro .intro__image img {
    border-width: 20px;
  }
}
@media (min-width: 1200px) {
  .content__container .intro .intro__image img {
    border-width: 35px;
  }
}
.content__container .intro .intro__heading-and-link {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: space-evenly;
  -ms-flex-pack: space-evenly;
  justify-content: space-evenly;
  font-size: 1rem;
}
@media (min-width: 600px) {
  .content__container .intro .intro__heading-and-link {
    padding-left: 2rem;
    padding-bottom: 0.3rem;
  }
}
@media (min-width: 900px) {
  .content__container .intro .intro__heading-and-link {
    padding-left: 3rem;
  }
}
@media (min-width: 1200px) {
  .content__container .intro .intro__heading-and-link {
    padding-left: 4rem;
  }
}
.content__container .intro .intro__heading-and-link h1 {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  color: var(--clr1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  font-size: 1.6rem;
  line-height: 2rem;
  text-align: center;
}
@media (min-width: 600px) {
  .content__container .intro .intro__heading-and-link h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.15rem;
    line-height: 2.4rem;
  }
}
@media (min-width: 750px) {
  .content__container .intro .intro__heading-and-link h1 {
    font-size: 2.4rem;
    line-height: 3.2rem;
  }
}
@media (min-width: 900px) {
  .content__container .intro .intro__heading-and-link h1 {
    font-size: 2.8rem;
    line-height: 4rem;
  }
}
@media (min-width: 1200px) {
  .content__container .intro .intro__heading-and-link h1 {
    font-size: 4rem;
    line-height: 4.8rem;
  }
}
.content__container .intro .intro__heading-and-link a {
  background-color: transparent;
  border: 5px solid var(--clr1);
  border-radius: 0.4rem;
  color: var(--clr1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  font-size: 1.4rem;
  font-weight: 100;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  letter-spacing: 0.1rem;
  margin-top: 1.2rem;
  padding: 2rem;
  text-align: center;
  text-decoration: none;
  -webkit-transition: all 1s;
  transition: all 1s;
}
@media (min-width: 600px) {
  .content__container .intro .intro__heading-and-link a {
    padding: 2rem;
  }
}
@media (min-width: 900px) {
  .content__container .intro .intro__heading-and-link a {
    border-width: 10px;
    font-size: 2rem;
    padding: 2.4rem 4rem;
  }
}
.content__container .intro .intro__heading-and-link a:hover {
  background-color: var(--clr2);
  border-color: var(--clr1);
  color: var(--clr4);
}

section {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  border-bottom: 2px solid var(--clr3);
  color: var(--clr1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  padding: 3rem 1rem;
}
section > * {
  width: 100%;
}
@media (min-width: 1200px) {
  section {
    padding: 4rem 2rem;
  }
}
section #video {
  width: 400px;
  height: 220px;
}
@media (min-width: 600px) {
  section #video {
    height: 400px;
    width: 100%;
  }
}
@media (min-width: 900px) {
  section #video {
    height: 600px;
    width: 100%;
  }
}
@media (min-width: 1200px) {
  section #video {
    height: 800px;
    width: 100%;
  }
}

h2 {
  -ms-flex-item-align: center;
  align-self: center;
  color: var(--clr-white);
  border-bottom: 4px solid var(--clr1);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  font-weight: 100;
  font-size: 1.8rem;
  letter-spacing: 0.12rem;
  margin-bottom: 2rem;
  margin-left: 0.6rem;
  padding-bottom: 0rem;
}
@media (min-width: 600px) {
  h2 {
    font-size: 2rem;
  }
}
@media (min-width: 900px) {
  h2 {
    border-bottom: 5px solid var(--clr1);
    font-size: 2.4rem;
  }
}
@media (min-width: 1200px) {
  h2 {
    border-bottom: 6px solid var(--clr1);
    font-size: 2.8rem;
  }
}

form {
  background: #845339;
  background: linear-gradient(135deg, #845339 0%, rgba(63, 34, 24, 0.5) 100%);
  background: -webkit-linear-gradient(
    270deg,
    #845339 0%,
    rgba(63, 34, 24, 0.5) 90%
  );
  border-radius: 0.4rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  padding: 2rem;
  width: 100%;
}
@media (min-width: 600px) {
  form {
    padding: 3rem;
  }
}
@media (min-width: 900px) {
  form {
    padding: 4rem;
  }
}
form > * {
  border: 0;
  border-radius: 0.4rem;
  font-family: var(--ff);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
form > *::-webkit-input-placeholder {
  color: var(--clr3);
  text-align: center;
}
form > *::-moz-placeholder {
  color: var(--clr3);
  text-align: center;
}
form > *:-ms-input-placeholder {
  color: var(--clr3);
  text-align: center;
}
form > *::-ms-input-placeholder {
  color: var(--clr3);
  text-align: center;
}
form > *::placeholder {
  color: var(--clr3);
  text-align: center;
}
@media (min-width: 900px) {
  form > * {
    margin-bottom: 2rem;
  }
}
@media (min-width: 1200px) {
  form > * {
    margin-bottom: 2.4rem;
  }
}
form input[type="email"] {
  background-color: var(--clr4);
  color: var(--clr1);
  padding: 1rem;
  text-align: center;
}
form input[type="email"]::-webkit-input-placeholder {
  color: var(--clr1);
}
form input[type="email"]::-moz-placeholder {
  color: var(--clr1);
}
form input[type="email"]:-ms-input-placeholder {
  color: var(--clr1);
}
form input[type="email"]::-ms-input-placeholder {
  color: var(--clr1);
}
form input[type="email"]::placeholder {
  color: var(--clr1);
}
form input[type="submit"] {
  background-color: var(--clr1);
  color: var(--clr4);
  cursor: pointer;
  padding: 1rem;
  -webkit-transition: all 1s;
  transition: all 1s;
}
form input[type="submit"]:hover {
  background-color: var(--clr4);
  color: var(--clr1);
}

footer p {
  color: var(--clr4);
}
footer p a {
  color: var(--clr4);
}
footer p a:hover {
  text-decoration: none;
}

/*# sourceMappingURL=style.css.map */

              
            
!

JS

              
                
              
            
!
999px

Console