Firefox and Google Chrome css not the same?

When i test this

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

the results are erroneous, not the same.

Are both based on the same standard?

+3
source share
3 answers

Each browser has its own default styles.

You should cancel the default browser settings with the "reset" style sheet (here's 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; }
+2
source

HTML and CSS are displayed by each browser as they consider it to be better, based on some conditions. This can be done without breaking the standard.

Think of it as two people reading a common text: their voices are different, even if they both read it correctly.

, , , .

+1

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

However, even a reset does not always work, but you can try them. They, of course, alleviate pain to some extent.

+1
source

Source: https://habr.com/ru/post/1745680/


All Articles