开发者

Firefox and Google Chrome css not the same?

When I test this

http://www.andrew开发者_运维知识库sellick.com/examples/sliding-side-bar/#

results are buggy and not the same.

Don't both based on the same standard ?


Every browser has it's own default styles.

You should un-apply the browser defaults with a "reset" stylesheet (here is mine):

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 and CSS are rendered by each browser how they think it is better, based on some conditions. This can be done without violating the standard.

Think about it like two people reading a common text: their voices differ even if they both are reading it correctly.

That said, if you told us more in detail what you would expect to see, we would be able to actually help you.


You can also use YUI to reset default browser css: http://developer.yahoo.com/yui/reset/

That said, even resetters don't always work, but you can try them out. They'll certainly ease the pain to some degree.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜