html - 如何对齐下拉列表和 img 按钮?

标签 html css

您好,我有以下(查看)html 代码和 css 产生了这个结果,我该如何对齐它?

结果

enter image description here

查看

<div class="divfloatleft" >@Html.DropDownListFor(model => model.tintFactorType , slFactorType, new { @class = "divfloatleft rulestextbox5" })</div>
<div class="divfloatleft" >@Html.TextBoxFor(model => model.decFactorValue, new { @class = "divfloatleft rulestextbox6" })</div>
<div class="divfloatleft" >@Html.TextBoxFor(model => model.decMaxBonus, new { @class = "divfloatleft rulestextbox7" })</div>
<div class="divfloatleft" >@Html.TextBoxFor(model => model.nvarMsg , new { @class = "divfloatleft rulestextbox8" })</div>
<div class="divfloatleft" >@Html.TextBoxFor(model => model.varVCode  , new { @class = "divfloatleft rulestextbox9" })</div>
<div  onclick="removeControl(this);return false;" class="remove removeimg divfloatleft"></div>

CSS

.rulestextbox5 {
    min-width: 125px !important;  
    width:125px !important;  
    height:30px !important;  
    margin-right:6px;
    top:30px;
}


.rulestextbox6 {
    min-width: 80px !important;  
    width:80px !important;  
    height:20px !important;  
    margin-right:6px;
}


.rulestextbox7 {
    min-width: 89px !important;  
    width:89px !important;  
    height:20px !important;  
    margin-right:6px;
}


.rulestextbox8 {
    min-width: 72px !important;  
    width:72px !important;  
    height:20px !important;  
    margin-right:6px;
}


.rulestextbox9 {
    min-width: 70px !important;  
    width:70px !important;  
    height:20px !important;  
    margin-right:6px;
}

.removeimg { 
     cursor:pointer;
    width: 19px !important;    
    height: 18px !important;  
    background: transparent url("images/basicsetup/remove.png") no-repeat center center !important; 
}

最佳答案

除了您向我们展示的 CSS 之外,请记住使用开发工具检查可能影响您的组合框和 div 的 CSS。

position: relative;
top: 0px;

关于html - 如何对齐下拉列表和 img 按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18909984/

相关文章:

angular - 在没有 jquery 的情况下向下滚动时,粘性菜单会改变颜色

javascript - 接下来的3个

javascript - 如何让document.write从左上角开始写?

HTML CSS 文本对齐

html - 100% div 高度的可滚动导航

javascript - 更改 React 组件的 CSS 会影响所有其他页面

javascript - 如何创建一个新的 html/javascript 可识别的网络字符符号?

javascript - 从数据表中删除一行

jquery - 我应该避免在样式表中定义的 CSS 类上使用 jQuery 选择器吗?

html - 水平滚动表格而不将它们包装在 div 中