Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ 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

Auto Save

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

              
                <!DOCTYPE html>
<html lang="en">
    <head>
        <title>My super cool & responsive website!</title>

        <!-- Main Stylesheet -->
        <link rel="stylesheet" type="text/css" href="style.css">

        <!-- Google Font -->
        <link rel="preconnect" href="https://fonts.gstatic.com">
        <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600&display=swap" rel="stylesheet">
    </head>
    <body>
        
        <section class="hero-banner-section flex flex-ac">
            <div class="container">
                <div class="text-wrap">
                    <h1 class="tc-wht ta-center">Welcome to my super cool website about avocados!</h1>
                    <div class="btn-wrap flex-jc">
                        <a href="about.html" class="btn">Read More</a>
                    </div>
                </div>
            </div>
        </section>

    </body>
</html>
              
            
!

CSS

              
                /* My External CSS File */


/* 1. Setup/Resets */
* {
    padding: 0;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

body {
    min-height: 100vh;
    overflow: auto;
}

a {
    text-decoration: none;
}

/* 2. Universal Elements */

/* Variables */
:root {
    --primary-color: #50330C;
    --accent-color: #68BA84;
    --offwhite-color: #F8F8F8;
    --white-color: #FFFFFF;
    --text-color: #939393;
    --font-main: 'Poppins', sans-serif;
    --font-weight-light: 300;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
}

/* Button */
.btn {
    display: block; 
    padding: 25px 40px;
    text-align: center;
    min-width: 140px; 
    font-size: 14px;
    line-height: 30px;
    font-weight: var(--font-weight-medium);
    color: var(--white-color);
    background: var(--accent-color);
    transition: 0.4s all ease-in-out;
}
@media (hover: hover) {
    .btn:hover {
        background: var(--primary-color);
    }
}

.btn-wrap {
    display: flex;
    margin-top: 30px; 
}

/* Typography */
body {
   font-family: var(--font-main); 
}

h1 {
   font-size: 43px;
   line-height: 51px;
   letter-spacing: 0;
   color: var(--primary-color);
   font-weight: var(--font-weight-semibold);
}

h2 {
   font-size: 33px;
   line-height: 45px;
   letter-spacing: 0;
   color: var(--primary-color);
   font-weight: var(--font-weight-semibold);
}

p {
    font-size: 14px;
    line-height: 30px;
    letter-spacing: 0;
    color: var(--text-color);
    font-weight: var(--font-weight-light);
}

/* Responsive - Medium Tablet */
@media only screen and (max-width: 991px) {
    h1 {
        font-size: 32px;
        line-height: 42px;
    }
}


/* 3. Ready Classes */

/* Flexbox Ready Classes */
.flex {
    display: flex;
}
.flex-sb {
    justify-content: space-between;
}
.flex-ac {
    align-items: center;
}
.flex-jc {
    justify-content: center;
}
.flex-ae {
    align-items: flex-end;
}
.flex-je {
    justify-content: flex-end;
}
.flex-col {
    flex-direction: column;
}
.flex-wrap {
    flex-wrap: wrap;
}


/* Width Ready Classes */

/* 20% wide */
.twenty {
  width: 20%;
}

/* 25% wide */
.twenty-five {
  width: 25%;
}

/* 30% wide */
.thirty {
  width: 30%;
}

/* 35% wide */
.thirty-five {
  width: 35%;
}

/* 40% wide */
.forty {
  width: 40%;
}

/* 45% wide */
.forty-five {
  width: 45%;
}

/* 50% wide */
.fifty {
  width: 50%;
}

/* 55% wide */
.fifty-five {
  width: 55%;
}

/* 60% wide */
.sixty {
  width: 60%;
}

/* 70% wide */
.seventy {
  width: 70%;
}

/* 75% wide */
.seventy-five {
  width: 75%;
}

/* 80% wide */
.eighty {
  width: 80%;
}

/* 100% wide */
.full {
  width: 100%;
}


/* Containers */

.container {
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 100px 50px;
}

.container-large {
    width: 100%;
    margin: 0 auto;
    padding: 0 50px;
}

@media only screen and (max-width: 1070px) {
    .container {
        padding: 50px 20px;
    }
    .container-large {
        padding: 0 20px; 
    }
}


/* Background Colors */

.bg-white {
    background: var(--white-color);
}

.bg-offwhite {
    background: var(--offwhite-color);
}

.bg-primary {
    background: var(--primary-color)
}

.bg-accent {
    background: var(--accent-color);
}


/* Text Colors */

.tc-wht {
    color: var(--white-color);
}

.tc-prim {
    color: var(--primary-color);
}

.tc-acc {
    color: var(--accent-color);
}


/* Text Alignment */

.ta-center {
    text-align: center;
}

.ta-right {
    text-align: right;
}


/******************************************************/
/******************************************************/
/******************** SITE HEADER *********************/
/******************************************************/
/******************************************************/

header.main-header {
    padding: 10px 0; 
    position: relative;
    overflow: visible; 
}
header.main-header .nav-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
header.main-header .menu-item {
    padding: 0 15px; 
}
header.main-header .menu-item a {
    display: block;
    color: var(--text-color);
    font-size: 14px;
    line-height: 30px;
    font-weight: var(--font-weight-semibold);
    position: relative;
    transition: 0.4s all ease-in-out;
}
header.main-header .menu-item a:after {
    content: "";
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: 0.4s all ease-in;
}
header.main-header .menu-item a.active:after {
    width: 100%; 
}

@media (hover: hover) {
    header.main-header .menu-item a:hover {
        color: var(--accent-color); 
    }
    header.main-header .menu-item a:hover:after {
        width: 100%;
    }
}

.hamburger {
    display: none;
    position: relative;
    width: 25px; 
    z-index: 6;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-color);
    margin-bottom: 5px; 
}

.mobile-nav-menu {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-width: 500px;
    z-index: 5; 
}

/* Responsive - Large Tablet  */
@media only screen and (max-width: 1070px) {
    .hamburger {
        display: block;
    }
    .mobile-nav-menu {
        display: block;
    }
}


/******************************************************/
/******************************************************/
/**************** HERO BANNER SECTION *****************/
/******************************************************/
/******************************************************/

.hero-banner-section {
    background: url(https://cdn.freshfruitportal.com/2020/09/Palta.shutterstock_261520853-1.jpg) no-repeat center / cover;
    height: 50vw; 
    max-height: 700px;
    min-height: 300px; 
}
.hero-banner-section .text-wrap {
    max-width: 588px;
    margin: 0 auto; 
}

/* Responsive - Phone */
@media only screen and (max-width: 600px) {
  .hero-banner-section {
    height: auto;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console