html - 如何设置字段位置?

标签 html css

火狐、Safari、IE
enter image description here enter image description here enter image description here

可以看到在不同的浏览器中inputdiv之间有1-2px的差异,如何清除?

HTML:

<input type="text" class="my-input-select" disabled="disabled"/>
<div class="my-input-select-box" >
    <ul style="z-index:100">
        <li>All</li>
        <li>Products</li>
        <li>Categories</li>
        <li>Clients</li>
        <li>News</li>
    </ul>
</div>

CSS:

.my-input-select{
    border: 1px solid #acacac;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    padding: 5px;
    background: url(images/forms/select.png) no-repeat 98% center;
    cursor: pointer;
    display: block;
}

div.my-input-select-box{
    position: relative;
    margin: 0;
    padding: 0;
}

div.my-input-select-box ul{
    position: absolute;
    background: red;
    left: 110px;
    top: 26px;
    width: 172px;
    z-index: 100;
    margin: 0;
    padding: 0;
}

div.my-input-select-box li{
    border-bottom: medium none;
    color: #393939;
    cursor: pointer;
    display: block;
    font-size: 12px;
    line-height: 12px;
    list-style-type: none;
    margin: 0;
    padding: 6px 2px 6px 10px;
}

最佳答案

例如,您必须使用 html、css 重置 http://necolas.github.com/normalize.css/

关于html - 如何设置字段位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14810814/

相关文章:

Javascript 优雅地在 URL 的其余部分前面添加一个 slug?

html - CSS : Panel body slide down and slide up

javascript - 你如何制作一个滚动页面?

javascript - Shadow DOM 元素可以继承 CSS 吗?

jquery - 用于更改 div 的上一个和下一个按钮

html - 使用 HTML CSS 打印帐单 - 打印 A4

php - 如何从 javascript 捕获 php 的输出

html - CSS - 修复 TABLE 的错误

javascript - 检测图像上的矩形形状并在其上添加一个 div Jquery

javascript - 根据单选按钮的可见性执行验证