Chrome 和 FF 的页面差别很大,好像 Chrome 的 border 在 li 里面,所以高度是 130px,而 FF 的 border 在外面,所以高度是 150px。
我已经为代码添加了更多信息。
<div class="service_promos cf">
<ul>
<li>
<h2><a>item1</a></h2>
</li>
<li>
<h2><a>item2</a></h2>
</li>
</ul>
</div>
这是CSS:
.service_promos {
margin-top: 0;
}
.service_promos ul {
width: auto;
margin: 0;
padding: 0;
list-style: none;
list-style-image: none !important;
}
.service_promos li {
background: none;
border-bottom: 10px solid #e2e1d6;
border-left: 10px solid #e2e1d6;
border-right: 10px solid #e2e1d6;
min-height: 130px;
margin-top: 0 !important;
padding-right: 1em;
list-style-type: none;
padding: 1em 2em;
display:block;
}
.service_promos h2 {
float: left;
margin-left: 5%;
margin-top: 0;
width: 70%;
color: #FF6526;
font-size: 2.5em;
font-style: normal;
font-weight: 700;
line-height: 1em
}
.service_promos h2 a {
color: #FF6526;
text-decoration: none;
}
最佳答案
您提供的商品看起来还不错。
如果您仍然对它们的外观不满意,您可能需要考虑使用 Normalize.css 或 Reset.css 在您的元素/页面中引用。
这些样式表的目的是帮助“规范化”所有常用元素,以便它们在不同的浏览器和环境中显示相似。
(我建议检查您是否有任何其他加载项或扩展可能会干扰您的任何元素的外观)
关于html - Chrome 和 Firefox 之间的水平高度不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17976552/