days when there was no web standard, browsers start to implement their own engine.
When the web standards were made at W3C old browser could not just start to use them. it would break most existing sites on the web.
So for backward compatibility they introduced two modes, an quirks mode for non-standard old sites, and standard mode, that implement on W3C standards.
———
How do browsers determine which mode to use?
In HTML documents, browsers use a DOCTYPE in the first line to decide a mode to handle.
So if you want to use standard mode make sure that your page starts with
<!DOCTYPE html>
did forget that or have a typo in doctype? congratulation you are in quirks mode
————
Whats The difference between the modes?
You can read the full list in MDN
————
How can I determine which mode is my doucment using?
document.compatMode in JS will give you information about the browser mode it can bde BackCompact (quirks) or CSS1Compact (standard)
if (document.compatMode == "BackCompat") {
// in Quirks mode
}
if(document.compactMode == "CSS1Comapct") {
// in standard mode
}
#web #modes #article #full_stacks
Обсуждают сегодня