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>
    <section id="main">
      <nav>
        <div class="logo">
          <a href="#">LogRocket</a>
        </div>
        <!--Navigation-->
        <ul class="menu">
          <li><a href="#main">Home</a></li>
          <li><a href="#services">Services</a></li>
          <li><a href="#contact">Contact</a></li>
        </ul>
      </nav>

      <div class="main-text">
        <h1>Hello!</h1>
        <p>Look at the box-shadows. Try hovering on the Navbar links.</p>
        <p>Check out the other sections.</p>
      </div>
    </section>
    <!--Services-->
    <section id="services">
      <div class="title">
        <h2>Services</h2>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur
          voluptatibus vel incidunt quod harum.
        </p>
      </div>
      <div class="content">
        <div class="service-box">
          <h2>Service A</h2>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis
            veniam soluta harum veritatis quisquam iure cumque et illum dolore
            eaque ipsum maiores blanditiis
          </p>
        </div>

        <div class="service-box">
          <h2>Service B</h2>
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Debitis
            veniam soluta harum veritatis quisquam iure cumque et illum dolore
            eaque ipsum maiores blanditiis
          </p>
        </div>


      </div>
    </section>
    <!--Contact-->
    <section id="contact">
      <div class="title">
        <h2>Contact</h2>
        <p>
          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Lorem, ipsum
          dolor.
        </p>
      </div>
      <div class="form">
        <div class="row">
          <input type="text" name="" placeholder="First Name" />
          <input type="text" name="" placeholder="Last Name" />
        </div>
        <div class="row">
          <input type="email" name="" placeholder="Email Address" />
          <input type="tel" name="" placeholder="Mobile No" />
        </div>
        <div class="row2">
          <textarea placeholder="Message"></textarea>
        </div>
        <div class="row2">
          <input type="submit" value="Send" />
        </div>
      </div>
    </section>
  </body>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Asap&family=Roboto:ital,wght@0,500;0,900;1,500&display=swap");

body{
  margin: 0px;
  padding: 0px;
  font-family: "Asap", sans-serif;
  background: #e0ffff;
}
*{
  box-sizing: border-box;
  scroll-behavior: smooth;
}
ul{
  list-style: none;
}
a{
  text-decoration: none;
}
/*Navigation*/
nav{
  top: 0;
  display: inline-flex;
  justify-content: space-around;
  align-items: center;
  height: 50px;
  width: 100%;
  position: fixed;
  z-index: 1;
  background: #ccc;
  box-shadow: 0px 2px 4px rgba(0,0,0,0.15), 
              0px 4px 8px rgba(0,0,0,0.15), 
              0px 8px 16px rgba(0,0,0,0.15), 
              0px 16px 32px rgba(0,0,0,0.15);
}
.logo a{
  font-family: "Roboto", sans-serif;
  font-weight: 600;
  color: #2c2c2c;
  font-size: 2rem;
}
.menu{
  display: flex;
}
.menu a{
  height: 40px;
  margin: 10px;
  line-height: 43px;
  padding: 0 40px;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  color: #2c2c2c;
  border-radius: 5px;
}
.menu a:hover{
  color: #000;
  background-color: #c0c0c0;
  box-shadow: inset 0px 2px 4px rgba(0,0,0,0.15), 
              inset 0px 4px 8px rgba(0,0,0,0.15), 
              inset 0px 8px 16px rgba(0,0,0,0.15);
  transition: 0.2s;
  transform: translateY(2px);
}
/*Home*/
#main {
  width: 100%;
  height: 100vh;
}
.main-text{
  position: absolute;
  left: 25%;
  top: 40%;
  transform: translate(-13%,-42%);
  color: #2c2c2c;
}
.main-text h1{
  font-size: 3.5rem;
}
.main-text p{
  font-size: 2rem;
  margin: 25px 0px 25px;
}
/*Services*/
#services{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 25px;
}
.title{
  width: 100%;
  text-align: center;
}
.title h2{
  position: relative;
  text-transform: uppercase;
  font-size: 3rem;
  margin-bottom: 30px;
}
.content {
display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0px;
}
.service-box {
  width: 400px;
  height: 250px;
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 10px;
  margin: 10px;
  box-shadow: 0px 2px 4px rgba(0,0,0,0.15), 
              0px 4px 8px rgba(0,0,0,0.15), 
              0px 8px 16px rgba(0,0,0,0.15), 
              0px 16px 32px rgba(0,0,0,0.15);
  background-color: #fff;
}
.service-box:hover{
  box-shadow: 0px 2px 4px rgba(0,0,0,0.2), 
              0px 8px 8px rgba(0,0,0,0.2), 
              0px 16px 16px rgba(0,0,0,0.2), 
              0px 32px 32px rgba(0,0,0,0.2);
  transform: translateY(-10px);
  transition: 0.2s;
}
.service-box p {
  text-align: center;
  width: 230px;
  margin: 0px 0px 20px 0px;
  color: #2c2c2c;
}
/*Contact*/
#contact{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 40px 0px;
}
.form{
  width: 100%;
  max-width: 700px;
  margin-top: 20px;
}
.row{
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 20px;
  margin-top: 20px;
}
.row2{
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}
.row input, .row2 textarea{
  width: 100%;
  padding: 10px;
  border: none;
  outline: none;
  color: #2c2c2c;
  background: #fff;
  font-size: 15px;
  box-shadow: 0px 0px 0px 1px rgba(0,0,0,0.15), 
              0px 4px 8px rgba(0,0,0,0.15), 
              0px 8px 16px rgba(0,0,0,0.15), 
              0px 16px 32px rgba(0,0,0,0.15);
  border-radius: 5px;
  font-family: 'Asap';
}
.row2 textarea{
  resize: none;
  height: 200px;
}
.row2 input[type='submit']{
  height: 40px;
  margin: 10px;
  width: 150px;
  line-height: 43px;
  padding: 0 40px;
  display: inline-block;
  font-size: 1rem;
  font-weight: 600;
  color: #2c2c2c;
  background: #ccc;
  border-radius: 5px;
  border: 0.5px solid #c0c0c0;
  font-family: 'Asap';
}
.row2 input[type='submit']:hover{
  color: #000;
  background-color: #c0c0c0;
  box-shadow: inset 0px 2px 4px rgba(0,0,0,0.15), 
              inset 0px 4px 8px rgba(0,0,0,0.15), 
              inset 0px 8px 16px rgba(0,0,0,0.15);
  transition: 0.2s;
  transform: translateY(2px);
}
              
            
!

JS

              
                
              
            
!
999px

Console