html - ie7 中不使用 padding

标签 html css internet-explorer internet-explorer-7

我在性别选择列表中使用了填充,但它在 ie7 中不起作用。 它在所有浏览器 ie8、firefox、safari 中都能正常工作,但无法正常工作 在iee7中我尝试了很多但什么也没发生......

<div class="clear" style="margin-top:5px; float:left; text-align:right">
                          <% @sex = [['male', '0'],['female', '1'], ['others', '2']] %> 
                          <%= select_tag :sex,
options_for_select(@sex), :style=>"padding-left:15px; width:100px;
height:30px;padding-left:15px;vertical-align:middle;" %>
</div>

谢谢 马尤尔伴侣

最佳答案

只需在 div 中添加 display: inline-block 并使用正确的 DOCTYPE,例如

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

关于html - ie7 中不使用 padding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2947656/

相关文章:

javascript - jQuery 验证名称属性包含方括号的字段?

javascript - 如何让HTML的title属性停留更长时间

html - 如何设置第二个div的高度占用剩余空间?

html - 清除 div 在 IE 和 chrome 中不起作用

jQuery:$(document).ready() 在 IE 中太慢

internet-explorer - Karma 无法在 64 位 Windows 上捕获 Internet Explorer 10

html - 对齐图形标题下方的按钮

html - 如何让 "fit-content"跨浏览器工作?

css - 表格中 IE8 填充导致边框隐藏的解决方法

html - 如何删除无序列表创建的缩进