按钮未对齐以选择表单

时间:2014-06-29 22:22:41

标签: html css forms twitter-bootstrap-3

按钮位于选择表单下方。它们都位于表格的列中。如何使选择表单右侧的按钮位于它们之间,并且它们之间有一些空间。

HTML:

 <form class='form-horizontal'>
        <fieldset  >   
            <span class='control-group' >
            <span  class='controls'>
                <select id='fl' class='form-control' style='cursor:pointer;'>
                    <option value='1'>Option1</option>
                   <option value='2'>Option2</option>
                   </select>

            </span>
            </span>
            <div><button id='mybtn' type='button'>Save</button></div>
        </fieldset>

    </form>

CSS:

#fl{
    padding: 3px;
    height:25px;
    font-style: italic;
    width:150px;
    margin-right: 0px;
}

在inspect元素中,&#34; <select id='fl' class='form-control' style='cursor:pointer;'&gt;`&#34;悬停时,尽管在我的css文件中将其设置为0px,但在橙色的右侧显示了很多边距。

的jsfiddle:http://jsfiddle.net/qJ8ee/

1 个答案:

答案 0 :(得分:0)

试试这个:

#fl{
    padding: 3px;
    height:25px;
    font-style: italic;
    width:150px;
    margin-right: 0px;
    float:left;
}

的jsfiddle:

http://jsfiddle.net/qJ8ee/2/