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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                #navigation 
  img.logo(src="https://lh3.googleusercontent.com/6yb5-p5ISlkNXzPZKso32C2wP3YY0CY7tzSlXnsF1r8JgwZcGI24kaKVHe5sQ4D1fcFvqI3MxJhpRoq5YwznYc02RUV8L7QBzSqeHp7JPC5TTpbEJ6-EuRQTZMUlE1cMj_pnGB-t0sK-6X270jfTHU-ztIOOyLY2hbsgSaKeFIFCfhkOuBJ4EPs1z2hQPhkTCiNvbsY1rpyKecVkkin6V7D706PaNX00jjTKiTbmbMaITHZ7ez2LwOJbHvEKMKfpq32jplZw0dao26wgkLh37hDxoQrVyjSOTyz5uw-6IrJaEpOXnJzhryEsHQIW9t7OzSACgf-dT01dhW87VYhvFwB9kcRh3UTUhzBqJr3ii065qEgwGPoVcUjlWqYBy9aHkhWl6fyMyqoX_7944-zcgO_IxDy4k-4FecHFYm5ajiMIo9W-O-3XYsD87fOad1_EIAwv7ZaTpReKeq3XFWJWO4PasNxztF98FvjZVdOZQzp5XL99QiTkNDW8WzD3CZQj-4pc2P3JQsr4HNvwCpnsX2YxoQlkdRUgXmt4Ed2JIQKVpBFAiERNlb43hdwY_tqLkYINPJJ9kVMuRZYipA7ucgwJx6G38Mx_6n6Wdlk=w256-h56-no")
  .menu
    .hamburger-menu
      .bar
    ="MENU"
    
  
#hero-image
  .overlay
  .overlay-shadow
  .hero-message="Where do you want to go today?"
  .hero-message2="SEE PROGRAMS"
    .down-arrow

#programs-wrapper
  h3="Choose a Program:"
  
  #filter-wrapper
    for val in ["Destination", "Duration", "Your Age", "Area of Interest"]
      .h300
        .select.collapsed
          .shown=val
          .option="Option One"
          .option="Option Two"
          .option="Option Three"
    
  ul#programs-list
    - for (i = 0; i < 9; i++)
      if i % 3 == 0
        li.program.top-pick
          .prog-image-wrap
            img.prog-image(src="https://cdn1.teach.com/content/41ae60bfc2a94ef98eb7f539e7e0c382/high-school.jpg")
          
          .program-details
            p.prog-title="Belgium-Flanders High School"
            p.prog-desc="Experience a magical country at the heart of Western Europe by attending high school in Belgium Flanders"
            p.prog-destination="DESTINATION"
              span="Belgium-Flanders"
            
            ul.prog-further-info
              li.detail
                p.title="Duration"
                p.info="About 5 months"
              li.detail
                p.title="Cost"
                p.info="$10,900 - $12,000"
              li.detail
                p.title="Offered In"
                p.info="Feb 2017 - Jul 2017"
      else
        li.program
          .prog-image-wrap
            img.prog-image(src="https://cdn1.teach.com/content/41ae60bfc2a94ef98eb7f539e7e0c382/high-school.jpg")
          
          .program-details
            p.prog-title="Belgium-Flanders High School"
            p.prog-desc="Experience a magical country at the heart of Western Europe by attending high school in Belgium Flanders"
            p.prog-destination="DESTINATION"
              span="Belgium-Flanders"
            
            ul.prog-further-info
              li.detail
                p.title="Duration"
                p.info="About 5 months"
              li.detail
                p.title="Cost"
                p.info="$10,900 - $12,000"
              li.detail
                p.title="Offered In"
                p.info="Feb 2017 - Jul 2017"
                
#footer
  .footer-top
    div
      p.title="About Hickox International"
      p.body="Hickox International is the world's most experienced and trusted beard exchange organization. Hickox International is a fully accredited overseas facial hair exchange organization in each state of the United Staes of America."
    div
      p.title.contact="Contact Us"
      p.body.contact
        |To speak with an Hickox Internation Representative, |call 1300 131 736
        |
        |Office business hours:  3pm - 3am Monday - Friday |(Birmingham Time)

  .footer-bottom
    p.copyright="© Hickox International, USA. All Rights Reserved 2016"
              
            
!

CSS

              
                $bar-width: 20px;
$bar-height: 2px;
$bar-spacing: 5px;
/*===========
  NAVIGATION
=============*/
#navigation {
  position: absolute;
  width: 100%;
  box-sizing: border-box;
  padding: 50px 7.5% 0 7.5%;
  z-index: 2;
    .logo {
      width: 256px;
      height: auto;
    }
  .menu {
    float:right;
    color: white;
    font-size: 16px;
    background: #007bc3;
    padding: 19px;
    border-radius: 5px;
    .hamburger-menu {
      width: $bar-width;
      height: $bar-height + $bar-spacing*2;
      cursor: pointer;
      float: left;
      margin-right: 10px;
      margin-top: 2px;
    }

    .bar,
    .bar:after,
    .bar:before {
      width: $bar-width;
      height: $bar-height;
      border-radius: 2px;
    }

    .bar {
      position: relative;
      transform: translateY($bar-spacing);
      background: rgba(255, 255, 255, 1);
      transition: all 0ms 300ms;
    }

    .bar:before {
      content: "";
      position: absolute;
      left: 0;
      bottom: $bar-spacing;
      background: rgba(255, 255, 255, 1);
      transition: bottom 300ms 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
    }

    .bar:after {
      content: "";
      position: absolute;
      left: 0;
      top: $bar-spacing;
      background: rgba(255, 255, 255, 1);
      transition: top 300ms 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
    }
  }
}
/*===========
  HERO AREA
=============*/
#hero-image {
  position: relative;
  overflow: hidden;
  background: url(https://lh3.googleusercontent.com/MTBBRT1JYGGEEOd_BDIjJrQYNU90toGBQCwEwBbjzQsMsCDNPieFOHeKdTAoh1mHxUMx8hTZfbpJ28oAof_RN7ZEbnQ35Pzdawaw47RgWdzVfmZgHHt1TZfWCJQGXr6NQRKcxdcTazql_1O8nQkJOJFfyVtLVvTToXZ9GE6iHIUBpbjG1RcDsrSWWe1NADDg2fpUZHRj-kYbEAaXsNc4VS6HvjnHRZrW4zGqDxsbnFzItRdQLjZ6Ee_cE5cLOLoY2mjAkZEr1p270QGrFz1GER_DrDL7mPLVCwf-WSvky0bGWH6EUdFrSq7DvHnwhaEOy7SxhRzY-FUGeq9VHClfVkvvW8qpKkQ00GSmVy7XPoJvldQnBIujKVZUuK-o5ZE6IdoBj_4vk7mNYhmeagXsQc5YcFB7zzRt0jq5XRUsf9dKuj2TsS00Z8-h0txp6wBAZSoT_nOOox8DfXfk3BI1wsF_VpTSwZIBjeBcUI05rVOEB8ew748CpKLxH7Pf0GYD-OMonGZnxgFbK0_k5gA3KK8EQuMYR6jQ1FrrDDaTWTpSXKHNV1ZXQke9QivlRr_3Pw5vP2DqzULqnFqv3GL1pkb8ztkfp9WcSIMCwNE=w1447-h814-no);
  height: 600px;

  .overlay {
    background: linear-gradient(135deg, rgba(134,43,137,0.9) 0%,rgba(215,27,93,0.9) 100%);
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
  }
  .overlay-shadow {
    position: absolute;
    width: 100%;
    height: 1px;
    top: 0;
    box-shadow: 0 0 250px 100px rgba(0,0,0,0.6);
  }
  .hero-message, .hero-message2 {
    font-size: 70px;
    color: white;
    width: 50%;
    max-width: 650px;
    text-align: center;
    z-index: 3;
    top: 250px;
    left: 0;
    right: 0;
    position: absolute;
    margin: auto;
  }
  .hero-message2 {
    font-size: 13px;
    opacity: 0.8;
    top: initial;
    bottom: 65px;
    letter-spacing: 1.5px;
    .down-arrow {
      width: 18px;
      opacity: 0.8;
      position: absolute;
      left: 0;
      right: 0;
      margin: auto;
      &:before, &:after {
        margin-top: 10px;
        vertical-align: bottom;
        content: "";
        width: 2px;
        height: 20px;
        background: white;
      }
      &:before {
        transform: rotate(60deg);
        float: right;
      }
      &:after {
        transform: rotate(-60deg);
        float: left;
      }
    }
  }
}

/*==============
  PROGRAMS LIST
================*/
#programs-wrapper {
  padding-top: 90px;
  width: 85.5%;
  margin: auto;
  text-align: center;
  h3 {
    color: #494452;
  }
  #programs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 140px;
    li {
      float: left;
      position: relative;
      width: 31.9%;
      margin-right: 2%;
      height: 540px;
      margin-bottom: 35px;
      border: 1px solid #e5e5e5;
      border-bottom: 2px solid #e5e5e5;
      box-sizing: border-box;
      &.top-pick {
        border: 2px solid #e7175b;
        
        &:before {
          content: "Top Pick!";
          color: white;
          background: #e7175b;
          position: absolute;
          top: 0;
          left: 0;
          width: 100px;
          text-align: right;
          padding-right: 10px;
          line-height: 35px;
        }
      }
      &:nth-child(3n) {
        margin-right: 0;
      }
    
      .prog- {
        &image-wrap {
          width: 100%;
          height: 200px;
          overflow: hidden;
          .prog-image {
            width: 100%;
            height: auto;
          }
        }
      }
      .program-details {
        padding: 25px 0 53px 0;
        width: 90%;
        margin: auto;
        text-align: left;

        .prog-title {
          font-size: 20px;
          color: #494452;
          font-weight: 700;
        }
        .prog-desc {
          font-weight: 300;
          font-size: 13px;
          line-height: 1.5;
          color: #575757;
        }
        .prog-destination {
          text-transform: uppercase;
          color: #575757;
          font-weight: 300;
          font-size: 12px;
          span {
            text-transform: none;
            margin-left: 20px;
            color: #007bc3;
            font-size: 14px;
            font-weight: 700;
          }
        }
        .prog-further-info {
          list-style: none;
          width: 100%;
          margin: 0;
          padding: 0;
          height: auto;
          border-top: 1px solid #e5e5e5;
          margin-top: 25px;
          padding-top: 20px; 
          
          li {
            height: auto;
            padding: 0;
            margin: 0;
            border: 0;
            float: left;
            width: 47%;
            
            p {
              line-height: 0.5;
            }
            .title {
              text-transform: uppercase;
              color: #575757;
              font-weight: 300;
              font-size: 12px;
            }
            .info {
              font-size: 14px;
              font-weight: 600;
            }
          }
        }
      }
    }
  }
}

/*===========
  SELECTS
=============*/
#filter-wrapper {
  width: 720px;
  margin: auto;
  margin-top: 20px;
  height: 80px;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
}
.h300 {
  float: left;
  max-width: 180px;
  margin: 0 5px;
}
.h300 * {
  box-sizing: border-box;
  user-select: none;
}
.h40 {
  height: 40px;
}
.clear {
  clear: both;
}
.select {
  width: 170px;
  border-radius: 4px;
  border: 1px solid #cccccc;
  overflow: hidden;
  color: #494452;
  font-weight: 300;
  float: left;
  margin: 0;
  position: relative;
}
.select:before {
  content: '';
  position: absolute;
  background-color: #494452;
  width: 14px;
  height: 14px;
  -webkit-transform: rotate(45deg);
  top: 15px;
  right: 15px;
}
.select:after {
  content: '';
  position: absolute;
  background-color: #FFF;
  width: 14px;
  height: 14px;
  -webkit-transform: rotate(45deg);
  top: 20px;
  right: 15px;
}
.collapsed {
  height: 40px;
}
.collapsed:before {
  content: '';
  position: absolute;
  background-color: #494452;
  width: 14px;
  height: 14px;
  -webkit-transform: rotate(45deg);
  top: 10px;
  right: 15px;
}
.collapsed:after {
  content: '';
  position: absolute;
  background-color: #FFF;
  width: 14px;
  height: 14px;
  -webkit-transform: rotate(45deg);
  top: 5px;
  right: 15px;
}
.option {
  color: #FFF;
}
.option,
.shown {
  width: 170px;
  height: 40px;
  line-height: 40px;
  padding-left: 15px;
  cursor: pointer;
  background-color: #34495E;
  text-align: left;
}
.shown {
  background-color: #FFF;
  font-weight: 400;
}
.styled-select-container {
  position: relative;
  float: left;
  border-radius: 3px;
  overflow: hidden;
  height: 40px;
  width: 300px;
  margin: 10px;
  background-color: #FFF;
}
.styled-select-container:before {
  content: '';
  position: absolute;
  z-index: 1;
  background-color: #ffffff;
  width: 14px;
  height: 14px;
  -webkit-transform: rotate(45deg);
  top: 10px;
  right: 15px;
}
.styled-select-container:after {
  content: '';
  position: absolute;
  z-index: 1;
  background-color: #FFF;
  width: 14px;
  height: 14px;
  -webkit-transform: rotate(45deg);
  top: 5px;
  right: 15px;
}
.styled-select {
  position: relative;
  z-index: 2;
  background: transparent;
  -webkit-appearance: none;
  border: 0;
  height: 40px;
  width: 100%;
  text-indent: 15px;
  font-size: 16px;
  color: #ffffff;
  outline: none;
}

/*===========
  FOOTER
=============*/
#footer {
  background: #f7f7f9;
  display: block;
  clear: both;
  padding-top: 70px;
  position: relative;
  
  .footer-top, .footer-bottom {
    padding: 0 7.5%;
  }
  .footer-top {
    padding-bottom: 35px;
    > div {
      display: inline-block;
      width: 49.5%;
      &:first-child { float: left; }
      .body, .title {
        color: #3b444f;
        font-size: 15px;
      }
      .title {
        font-weight: 900;
      }
    }
  }
  .footer-bottom {
    background: #ededf1;
    text-align: center;
    position: absolute;
    width: 100%;
    padding: 0;
    
    .copyright {
      color: #7b8086;
      font-size: 12px;
      font-weight: 300;
      line-height: 20px;
    }
  }
}
              
            
!

JS

              
                var selectid;

$(document).on('click','.select',function(){
  selectid = $(this).index('.select');
  var adjust = ($(this).hasClass('collapsed')) ? 1 : 0;
  
  console.log((($(this).children('.option').length) * $(this).children('.option').height()) * (adjust) + 40 + 'px');
  
  $(this).animate({'height':(($(this).children('.option').length) * $(this).children('.option').height()) * (adjust) + 40 + 'px'},100);
  $(this).toggleClass('collapsed');
});
              
            
!
999px

Console