I'd like to know why browsers read the same page (HTML, CSS, and scripts) and the result displayed is different in some cases.
I'd like to know why browsers read the same page (HTML, CSS, and scripts) and the result displayed is different in some cases.
Within the browser, the part responsible for reading and interpreting HTML and CSS is called the rendering engine or rendering engine ), and there are several different engines in the market, so the page is presented differently.
It can be said that the rendering engine is one of the main components of the browser, and some rendering engines became famous and began to be used by more than one browser.
For example, the WebKit is used by # (Apple), and was used by Opera and by Google Chrome until recently, when it was changed by Blink .
There are also the JavaScript Interpreters , whose purpose is to interpret and execute the JavaScript code of the page, and which are also reused by more than one browser, such as Google's V8 and SpiderMonkey and the Rhino from Mozilla .
The fact that a lot of browsers adopt different rendering mechanisms makes it one of the main reasons for this to happen, for example:
SO
, however
when a font is not specified, it is up to the browser to decide. -webkit-*
when using CSS
. Still speaking of engines, of all browsers currently in existence, I believe that currently does not use the same engine, either for or for < > scripts .
Otherwise there are several other issues that are entirely the responsibility of the encoder, or almost so:
HTML
- simple statements like <!doctype *>
or even shiv
that arrives more like arrangement and so on. js
instead of css
. And several more of these. But I believe that the biggest problem is the structuring of the code HTML
- semantics, sketch etc. - and of the CSS
- properties - otherwise , the rest is less I think.