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

              
                <body>
  <header>
    <button class="hamburger-icon"><i class="fa fa-bars" aria-hidden="true"></i></button>
    <a href="index.html" class="logo"><img src="https://www.yudiz.com/codepen/hero-banner/logo.png" alt="logo-image"></a>
    <a href="#" class="search-icon"> <span>Search</span> <i class="fa fa-search" aria-hidden="true"></i></a>
  </header>
  <div class="nav">
    <div class="nav-content">
      <button class="cross-btn"><i class="fa fa-times" aria-hidden="true"></i></button>
      <ul>
        <li><a href="#"> Home </a></li>
        <li><a href="#"> about us </a></li>
        <li><a href="#"> products </a></li>
        <li><a href="#"> what we offers </a></li>
        <li><a href="#"> contact us </a></li>
      </ul>
      <ul class="terms-links">
        <li><a href="#">Terms & Conditions</a></li>
        <li><a href="#">Privacy Policy</a></li>
      </ul>
    </div>
  </div>
  <div class="banner">
    <div class="container">
      <div class="banner-inner">
        <div class="banner-image">
          <img src="https://www.yudiz.com/codepen/hero-banner/banner.png" alt="banner-image">
        </div>
        <div class="banner-content">
          <h1><b>A one stop for all solutions</b><br>
            for your<br>
            <span>industrial needs...</span>
          </h1>
          <a href="#" class="theme-btn">Get Quote</a>
        </div>
      </div>
    </div>
  </div>
</body>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800&display=swap");
* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
}
body {
  font-family: "Open Sans", sans-serif;
}
/*header styling starts*/
header {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  display: -webkit-flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: #fff;
  box-shadow: 0px 8px 7px -11px #000;
  -webkit-box-shadow: 0px 8px 7px -11px #000;
}
.hamburger-icon {
  background: transparent;
  border: transparent;
  font-size: 26px;
  line-height: 36px;
}
.hamburger-icon:hover {
  cursor: pointer;
}
.search-icon {
  text-decoration: none;
  color: #3d4244;
}
.search-icon i {
  margin-left: 10px;
}
/*navbar styling starts*/
.nav {
  border: 20px solid #d8d8d8;
  border-left: 0px;
  transition: all 0.5s;
  -webkit-transition: all 0.5s;
  position: fixed;
  border-radius: 0px 50% 50% 0px;
  top: -35px;
  overflow: hidden;
  left: -100%;
  width: 400px;
  background: url("https://www.yudiz.com/codepen/hero-banner/nav-banner.jpg")
    no-repeat center center / cover;
  height: calc(100vh + 97px);
  min-height: 700px;
  display: flex;
  display: -webkit-flex;
  align-items: center;
  -webkit-align-items: center;
}
.nav:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.8);
  width: 200%;
  height: 100%;
  border-radius: 0px 50% 50% 0px;
}
.nav-content {
  margin-left: 40px;
  position: relative;
  z-index: 1;
}
.nav-content .cross-btn {
  margin-bottom: 50px;
  background: transparent;
  color: #fff;
  border: transparent;
  font-size: 24px;
  line-height: 34px;
  padding: 5px 15px;
}
.nav-content .cross-btn:hover {
  cursor: pointer;
  transition: all 0.5s;
  -webkit-transition: all 0.5s;
}
.nav-content li {
  display: block;
  margin-bottom: 25px;
}
.nav-content li a {
  text-decoration: none;
  color: #fff;
  text-transform: capitalize;
  font-size: 16px;
  line-height: 26px;
  font-weight: 600;
  position: relative;
  padding: 5px 15px;
}
.nav-content li a:hover::after {
  opacity: 1;
  width: 100%;
}
.nav-content li a::after {
  opacity: 0;
  content: "";
  transition: all 0.5s ease;
  -webkit-transition: all 0.5s ease;
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: #fccb02;
  z-index: -1;
  transform: skewX(15deg);
  -webkit-transform: skewX(15deg);
  margin-left: 2px;
}
.terms-links {
  margin-top: 120px;
}
.terms-links li a {
  font-size: 12px;
  line-height: 22px;
}
/*header styling ends*/
/*banner styling starts*/
.container {
  width: 1170px;
  margin: 0px auto;
  padding: 0px 15px;
}
.banner-image {
  display: none;
}
.banner {
  background: url("https://www.yudiz.com/codepen/hero-banner/banner.png")
    no-repeat center center / 100%;
  width: 100%;
  height: 100%;
}
.banner-inner {
  height: calc(100vh + 97px);
  display: flex;
  align-items: center;
  -webkit-align-items: center;
}
.banner-content h1 {
  color: #3d4244;
  font-weight: 300;
  font-size: 47px;
  line-height: 70px;
  margin-bottom: 40px;
}
.banner-content h1 b {
  font-weight: 700;
}
.banner-content span {
  color: #fccb02;
  font-weight: 700;
}
.theme-btn {
  background-color: #fccb02;
  padding: 16px 50px;
  text-decoration: none;
  color: #3d4244;
  display: inline-block;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.5s;
  -webkit-transition: all 0.5s;
  border-radius: 5px;
}
.theme-btn:hover {
  background-color: transparent;
  border: 1px solid #fccb02;
}
/*jquery styling */
.nav-left {
  left: 0;
  transition: all 0.5s;
  -webkit-transition: all 0.5s;
}
/*banner styling ends*/
@media (min-width: 1450px) and (max-width: 1599px) {
  .container {
    width: 1310px;
  }

  .nav {
    width: 500px;
    top: -43px;
  }
}
@media (min-width: 1600px) and (max-width: 1920px) {
  .container {
    width: 1510px;
  }
  .nav {
    width: 500px;
    top: -48px;
  }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .nav {
    width: 400px;
    top: -45px;
  }
  .nav-content .cross-btn {
    margin-bottom: 30px;
  }
  .nav-content li {
    margin-bottom: 20px;
  }
  .terms-links {
    margin-top: 60px;
  }
  /*banner styling starts*/
  .container {
    width: 960px;
    padding: 0px 15px;
  }
  .banner-content h1 {
    font-size: 37px;
    line-height: 60px;
    margin-bottom: 20px;
  }
  .theme-btn {
    padding: 14px 50px;
  }
}

@media (min-width: 768px) and (max-width: 991px) {
  .nav {
    width: 370px;
    top: -44px;
  }
  .nav-content .cross-btn {
    margin-bottom: 30px;
  }
  .nav-content li {
    margin-bottom: 20px;
  }
  .terms-links {
    margin-top: 100px;
  }
  /*banner styling starts*/
  .container {
    width: 720px;
    padding: 0px 15px;
  }
  .banner-content h1 {
    font-size: 27px;
    line-height: 50px;
    margin-bottom: 10px;
  }
  .theme-btn {
    padding: 14px 40px;
  }
}
@media (max-width: 767px) {
  .nav {
    width: 295px;
    top: -44px;
  }
  .nav-content {
    margin-left: 20px;
  }
  .nav-content .cross-btn {
    margin-bottom: 20px;
  }
  .nav-content li {
    margin-bottom: 10px;
  }
  .nav-content li a {
    font-size: 14px;
    line-height: 24px;
  }
  .terms-links {
    margin-top: 50px;
  }
  header {
    padding: 20px;
  }
  header .search-icon span {
    display: none;
  }
  header .search-icon i {
    margin: 0px;
  }
  header .logo img {
    width: 150px;
  }
  .hamburger-icon {
    font-size: 22px;
    line-height: 32px;
  }
  /*banner styling starts*/
  .banner {
    background: transparent;
  }
  .banner-image {
    display: block;
  }
  .banner-image img {
    display: block;
    max-width: 100%;
  }
  .banner-inner {
    flex-direction: column;
    margin-top: 100px;
    height: auto;
  }
  .banner-content {
    margin-top: 15px;
    text-align: center;
  }
  .container {
    width: 100%;
    padding: 0px 15px;
  }
  .banner-content h1 {
    font-size: 22px;
    line-height: 40px;
    margin-bottom: 20px;
  }
  .theme-btn {
    padding: 10px 25px;
    font-size: 14px;
    line-height: 24px;
  }
}

              
            
!

JS

              
                $(document).ready(function () {
  $(document).on("click", ".hamburger-icon", function () {
    $(".nav").addClass("nav-left");
  });
  $(document).on("click", ".cross-btn", function () {
    $(".nav").removeClass("nav-left");
  });
});

              
            
!
999px

Console