5

How can I place dropdown with known width in div with known width and height?vertical align doesnt help me.

    <div id="wrapper">
       <select id="dropdown" ></select>
    </div>

    #wrapper{
       border-style:solid;
       height:100px;
       width:200px;
     }

    #dropdown {      
      vertical-align:middle;
      width:80px;
    }

Here is jsFiddle.

1 Answer 1

8
#wrapper {
    border-style:solid;
    height:100px;
    width:200px;
    display:table-cell;
    vertical-align:middle;
}
#dropdown { 
   width:80px;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.