出于某种原因,在 Internet Explorer 中,单词的缩进比 Chrome 或 Safari 中显示的要远。这是否有可能是由于各种浏览器的 CSS 差异所致?
<div class="container">
<div class="centered">
<?php
echo "<a href='/LOGO'>LOGO</a>";
?>
</div>
</div>
//CSS
.centered
{
position:relative;
margin:0 auto;
width: 954px;
}
.container
{
width:100%;
border-bottom: 1px solid gray;
font-size: 27px;
background: #4D94DB;
color: black;
min-height: 37px;
}
最佳答案
在第一行使用这个 css reset
:
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, caption {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: collapse;
border-spacing: 0;
}
引用 Reset CSS
关于php - CSS Internet Explorer 浏览器差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22275466/