cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="container">
    <span class="choose">Choose Gender</span>
  
      <div class="drop-menu">
        <div class="select">
          <span>Select Gender</span>
          <i class="fa fa-chevron-down"></i>
        </div>
        <input type="hidden" name="gender">
        <ul class="dropeddown">
          <li id="male">Male</li>
          <li id="female">Female</li>
        </ul>
      </div>
  
  <span class="msg"></span>
</div>
            
          
!
            
              * {
  outline: 0;
  font-family: sans-serif
}
body {
  background-color: #fafafa
}
span.msg,
span.choose {
  color: #555;
  padding: 5px 0 10px;
  display: inherit
}
.container {
  width: 500px;
  margin: 50px auto 0;
  text-align: center
}

/*Styling Selectbox*/
.drop-menu {
  width: 300px;
  display: inline-block;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 0 2px rgb(204, 204, 204);
  transition: all .5s ease;
  position: relative;
  font-size: 14px;
  color: #474747;
  height: 100%;
  text-align: left
}
.drop-menu .select {
    cursor: pointer;
    display: block;
    padding: 10px
}
.drop-menu .select i {
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: all .3s ease-in-out;
    float: right
}
.drop-menu:hover {
    box-shadow: 0 0 4px rgb(204, 204, 204)
}
.drop-menu:active {
    background-color: #f8f8f8
}
.drop-menu.active:hover,
.drop-menu.active {
    box-shadow: 0 0 4px rgb(204, 204, 204);
    border-radius: 5px 5px 0 0;
    background-color: #f8f8f8
}
.drop-menu.active .select i {
    transform: rotate(180deg)
}
.drop-menu .dropeddown {
    position: absolute;
    background-color: #fff;
    width: 100%;
    left: 0;
    margin-top: 1px;
    box-shadow: 0 1px 2px rgb(204, 204, 204);
    border-radius: 0 1px 5px 5px;
    overflow: hidden;
    display: none;
    max-height: 144px;
    overflow-y: auto;
    z-index: 9
}
.drop-menu .dropeddown li {
    padding: 10px;
    transition: all .2s ease-in-out;
    cursor: pointer
} 
.drop-menu .dropeddown {
    padding: 0;
    list-style: none
}
.drop-menu .dropeddown li:hover {
    background-color: #f2f2f2
}
.drop-menu .dropeddown li:active {
    background-color: #e2e2e2
}
            
          
!
            
              /*Select Box js*/
$('.drop-menu').click(function () {
        $(this).attr('tabindex', 1).focus();
        $(this).toggleClass('active');
        $(this).find('.dropeddown').slideToggle(300);
    });
    $('.drop-menu').focusout(function () {
        $(this).removeClass('active');
        $(this).find('.dropeddown').slideUp(300);
    });
    $('.drop-menu .dropeddown li').click(function () {
        $(this).parents('.drop-menu').find('span').text($(this).text());
        $(this).parents('.drop-menu').find('input').attr('value', $(this).attr('id'));
    });
/*End Select Box js*/


$('.dropeddown li').click(function () {
  var input = '<strong>' + $(this).parents('.drop-menu').find('input').val() + '</strong>',
      msg = '<span class="msg">Hidden input value: ';
  $('.msg').html(msg + input + '</span>');
}); 
            
          
!
999px
Loading ..................

Console