Hello!
I make custom select based on jQuery SelectmenuWidget plugin ( http://api.jqueryui.com/selectmenu ) everything seems to work as I want, except for one thing:
All elements that are on the same line as the selector slide down.
enter image description here

here the text should be in the center of the height, but for some reason it also slides down enter image description here


What could be the problem? I removed all the margins, paddings but zero sense.
ps with css and layout almost not familiar

Markup:

<div> <select class="reg_select_country"> <option value="+7">Россия +7</option> <option value="+7">Казахстан +7</option> <option value="+375">Белоруссия +375</option> </select> <span style="width:15%;font-size:11px;" id="reg_label_country">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+7 </span> <input type="text" name="phone" class="reg_input_phone" placeholder=" " style="width:48%;margin:0;position:relative;right:0"> </div> 

Js:

 $('.reg_select_country').selectmenu({'width': true, position:{}}); 

The CSS I touched in the plugin:

 .ui-selectmenu-menu { font-size: 15px; } .ui-selectmenu-menu .ui-menu { color: #696969; background: #ffffff; box-shadow: 0px 0px 7px 1px rgba(0, 0, 0, 0.3); max-height: 300px; } .ui-widget { font-size: 15px; } .ui-selectmenu-button span.ui-selectmenu-text { text-align: left; padding: 0.8em 2.1em 0.4em 1em; display: block; padding-bottom: inherit; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /*Установка стиля при наведении на item*/ .ui-widget-content .ui-state-focus{ border: 1px solid #999999; background: #000000; color: #ffffff; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { background: #ffffff; border: 1px solid #8e8e8e; } .ui-corner-all { border-radius: 0; } .reg_select_brithday + .ui-selectmenu-button { width: 87px; height: 50px; padding: 0; } .reg_select_brithmounth + .ui-selectmenu-button { width: 100px; height: 50px; padding: 0; } .reg_select_brithyear + .ui-selectmenu-button { width: 74px; height: 50px; padding: 0; } .reg_select_pol + .ui-selectmenu-button { width: 80px; height: 50px; padding: 0; } .reg_select_country + .ui-selectmenu-button { width: 35%; height: 50px; } .ui-state-default .ui-icon{ background-image: url("/images/register/trg.png"); } .ui-selectmenu-button:hover .ui-icon{ background-image: url("/images/register/trg_hover.png"); } .ui-icon-triangle-1-s { background-position: 0 ; } 

    1 answer 1

    For the elements to be in a row, you need to add display: inline-block to the elements in the CSS

    • unfortunately it did not help - QWERTY
    • one
      display: inline-block + vertical-align: middle; - soledar10
    • Earned! Even one vertical-align: middle; - QWERTY