Site not displaying correctly in IE - html

Can somebody explain me why my site is not displaying correctly in internet explorer:
http://shortener3.info/web/

The choice of Doctype (Transitional with no URL) triggers Quirks mode, which causes browsers to emulate bugs that appeared in earlier browsers in order to cope with legacy code.
IE emulates a lot of features of IE 5.5, which was very very broken.
Use a Doctype that triggers Standards (AKA Strict) mode.
That might not solve all the problems, but it should be the first step in trying to resolve them.

Related

Difference between IE Standard, Compatible & Quirks

I have gone throught many Solutions in stackoverflow but was not able to get. please anyone explain me in simple words
1) what is basic difference between IE Standard, Compatible, Quirks mode and how does it matters?
2) I want to force Webpage to load in IE7 in IE9 Browser ... is my below code correct?
<meta http-equiv="X-UA-Compatible" content="IE=IE7" />
IE=IE7 > Standard Mode
IE=EmulateIE7 > Compatible Mode
how to run in Quirks Mode
3) Is this modes applicable to browsers other IE?
4) What is default mode of Browser and how do i determine it?
First, you really don't want to be doing this - preferably run IE9 as IE9, even better, use IE 10/11, even better use Chrome, MS Edge etc.
But, assuming you are forced into it, your Meta tag should say content="IE=7"
This should force IE7 Standards mode and at least make everything consistent between IE7 and IE9 (well, it should, but there may still be anomalies). If there are you may need to detect IE9 and use EmulateIE7, but, again, this may cause more problems than it solves.
And, these modes only apply to IE - all other browsers ignore them.
And, you really don't want me to explain the difference between Standard, Compatible, and Quirks mode, partly because it would take 57 hours and partly because I've forgotten.
Good luck ...

Why Compatibility mode only in IE not in other browsers?

When i am checking my code with the developer tools (F12), I have seen the option Compatibility view only in IE browsers. Why don't other browsers have this compatibility view mode?
I am confused about this. Can you guys clarify, is there any specific reason for this?
Because IE is the only mainstream browser which was so screwed up in its rendering that developers had to specifically work around IE problems and deliver alternative versions of their pages just for IE. The "compatibility mode" switches between the newer standards compliant mode and the older screw-up mode.
Other browsers don't have it because they've never had an alternative screw-up mode.
As for I know, IE mostly have compatibility issues with the older versions, That's why this option is provided by Microsoft. Moreover, very soon IE will be part of history as Microsoft is launching it all new web browser Microsoft Edge. http://en.wikipedia.org/wiki/Microsoft_Edge

Using html5 quirks mode in IE9

I've created a form that is dynamically created with JavaScript and is added in another website using the <script> tag.
The doctype used by this other website is <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> which uses the quirks mode.
I've built my form by taking this in consideration and everything is working as expected in Chrome, Firefox and IE 10. However, when I test it in IE 9 and earlier, the form is not displayed at all. When I open the developper tools, I can see that IE 10 uses the new quirks mode but IE 9 and earlier uses the IE5 Quirks mode.
I was wondering if the new quirks mode can be used to display this page when using IE 9 and earlier. If this is not possible, I would like to force standard mode but only when using IE 9 or earlier and keep using quirks for every other browser.
I can't use the html5 doctype since their website is built with quirks mode instead of standards and their design is all broken when I use this doctype.
You cannot change the mode once the page is loaded. And you cannot change it programmatically. The only way to force a page into quirks mode is to load it without a valid doctype or with serious bugs in the HTML.
If you have a doctype, but your page is still loading in quirks mode, then it means that you have serious bugs in your HTML. This will give you bigger problems than just being in quirks mode. You should definitely fix those bugs. If you really want to be in quirks mode, drop the doctype, but you should really try not to have HTML code that is so bad it triggers quirks mode even with a doctype!
You can validate your HTML to find those bugs by using the W3C validator.
In terms of switching your page at runtime between IE10's two different quirks modes, the simple answer is that you can't do that.
Sorry about that.
However, to be honest, it's probably for the best. Using quirks mode is be a complete disaster anyway. It doesn't just change the layout mode; it also switches off most of the browser's features (ie pretty much everything invented since 1998).
But now for the good news:
Luckily, switching away from Quirks mode is a lot easier than you think.
The main layout issue (the different box model) can be fixed by adding the following to the top of your CSS:
*{box-sizing:border-box;}
This is the standards-compliant way to set the box model to the quirks-mode style layout. Most of the broken layout problems cause by switching from quirks mode to standards mode can be resolved with this simple CSS style.
There are other quirks, but they're relatively minor and shouldn't be too hard to deal with once you've fixed the main issue. A lot of them are actually not quirks mode issues, but bugs in older IE versions that the original coder may have had to hack his way around. There's no guarantee that these will continue working the same in future versions anyway, even if you do stick to quirks mode, so you would be best off fixing them now anyway.
So, to summarise:
Fix your page so it loads in standards mode. Valid doctype and valid HTML.
Use box-sizing to mitigate the main layout gremlins caused by the switch.
Fix the remaining layout issues manually.
It's really a lot less work than it sounds. Honest.

is quirks mode legit?

I was on vacation without access to my good friend Internet Explorer, and I threw together a pretty complete web app. When I got home, I was surprised and encouraged to see that my site was working in IE... until I threw in any sort of valid doctype. I know it isn't best practice to throw browsers into quirks mode, or it wouldn't be called quirks mode, but I guess my question is... what are the practical ramifications of having a 'quirks mode' site? Is it necessary or even worth it to painstakingly slave away to correct the issues of which I am yet unaware, or can I leave it as is, functioning cross browser? Thanks.
If your site renders wrong in standards mode, but correct in quirks mode, chances are it's errornous. Some current browsers may fix your mistakes even in standard mode, but you have no idea about what future browsers will do with it. With standards mode, you can be absolutely sure that a valid site that looks fine in modern browsers will show up correctly.
Browsers are more interoperable, i.e., have the same behavior as each other, in the no-quirks mode compared to the quirks mode. The no-quirks mode is what most Web standards people and browser developers care about and consider and test. So it's more likely that you run into differences between browsers in quirks mode.
For example, in quirks mode, the body fills the viewport in WebKit/Blink, but does not in Gecko (I'm not sure about Edge). In no-quirks mode, body height works the same in all browsers.
(There's one counter-example, though, where browsers agree in quirks mode but not in no-quirks mode: body being the "viewport scrolling element" for scrollTop etc.)
Some versions of IE (8 and 9?) deliberately had less features in their quirks modes (e.g. the canvas element). So if you care about IE and want to be able to use the features IE actually supports, just not in quirks mode, then that would be another reason to not use quirks mode.
Finally, and maybe obviously, you're likely to run into more "weird" behavior that is the quirks themselves, like color and some other stuff not inheriting into table elements, that top and bottom margins collapse more, IDs and classes being case-insensitive, and so on.
Declaring a proper doctype is technically required for HTML validation by W3; however, lots of people leave their code un-doctyped for browsers to use Quirks mode instead. I've done this many times and it usually works out fine; however, you run the risk of browsers not interpreting your code correctly.
In other words, the cross-browser functionality you speak of could very easily break down into cross-browser hell without valid doctype declarations.
A.k.a., it's up to you as to how robust your site needs to be.
Quirks mode typically is the browsers attempt at fixing your errors in order to render correctly, however it's important to remember that if your site renders in standards compliant mode it will likely render ok with future browsers (at least for the time being).

HTML 5 Doctype causing quirksmode?

Does using an HTML 5 Doctype cause Quirks mode in modern browsers, since HTML5 isn't out yet?
(That is Modern Browsers were out before HMTL5 started spreading, so they don't properly support it.)
If yes, does this mean that the HTML 5 Doctype is tentatively like none at all?
EDIT: If not, what does it do in browsers that don't support and the like?
No it doesn't, see this article.
What's nice about this new DOCTYPE, especially, is that all current browsers (IE, FF, Opera, Safari) will look at it and switch the content into standards mode - even though they don't implement HTML5. This means that you could start writing your web pages using HTML5 today and have them last for a very, very, long time.
According to Wikipedia table (that I love) HTML 5 DOCTYPE triggers full standard mode for:
FF, Chrome, Opera 7.5+, Safari, Konqeror 3.5+ and also IE8!!!
and triggers Almost standard mode [*] for:
IE6 and IE7
So it's definitely the best DOCTYPE ever created!
"One DOCTYPE to bring them all and in the darkness bind them..." [Lords of the rings]
[*] "Almost standards" does NOT make such a big difference to full standard mode, in the same Wikipedia link above you can find more details.
No it does not.