html - Firefox 和 Google Chrome 的 css 不一样?

标签 html css

当我测试这个时

http://www.andrewsellick.com/examples/sliding-side-bar/#

结果有问题而且不一样。

两者不是基于相同的标准吗?

最佳答案

每个浏览器都有自己的默认样式。

您应该使用“重置”样式表(这是我的)取消应用浏览器默认设置:

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,textarea,p,blockquote,th,td {
    margin:0;
    padding:0;
}
table {
    border-collapse:collapse;
    border-spacing:0;
}
fieldset,img {
    border:0;
}
address,caption,cite,code,dfn,em,strong,th,var {
    font-style:normal;
    font-weight:normal;
}

ul                              { list-style-type: none; }
ol                              { list-style-type: decimal; }

caption,th {
    text-align:left;
}
h1,h2,h3,h4,h5,h6 {
    font-size:100%;
    font-weight:normal;
}
q:before,q:after {
    content:'';
}
abbr,acronym { border:0;
}


html, body                      { line-height: 1; }
blockquote:before, blockquote:after, q:before, q:after         { content: ''; }
blockquote, q                   { quotes: "" ""; }


*                               { font-family: Verdana, "Trebuchet MS", sans-serif;
                                  font-size: 13px; color: #666;
                                  text-decoration: none; white-space: normal;
                                  vertical-align: baseline; }

input[text="submit"], button    { color: #000; }

关于html - Firefox 和 Google Chrome 的 css 不一样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2845290/

相关文章:

python - Django 模板中的二进制图像显示

android - 移动设备上的缩放问题虽然在桌面上工作正常

html - Chrome 中的媒体查询关闭了大约 20 像素

css - 绝对定位元素相对于转换元素的位置

jquery - 表格行高值与Firefox中实际显示高度不同

CSS div 不会随内容展开,而是提供滚动条?

html - 简单的 CSS/HTML - 嵌套元素

css - 我需要将元素符号列表项与同一行上的其他文本对齐

html - 帮助清除 float

jquery - 滚动时可以重新定位的页脚