开发者

What are the benefits of rendering in Standards Mode (besides more predictable rendering)?

I'm working with a Web Application and it's currently rendering in Quirks Mode. My feeling is that we should change this to use Standards Mode.

If were make this change there will be some pain in the short term as I would expect some of the pages that currently render fine in Quirks mode will need tweaking to show properly in Standards mode. If I'm going to do persuade other people this work there will need to be some benefits too.

Whilst easier page layout would be nice I'm not sure it would be enough on its own - as most the design for the app is done - so I was wondering if Standards mode offers any other more immediate benefits. Do pages render quicker? Will the browser use less memory? Anything else?

For what it's worth this application is used almost exclusively on IE6/7/8 but I'd be interested t开发者_如何学JAVAo hear how this applies to other browsers too.


Here are the benefits to standards mode:

1) Correct and accurate code is easier to maintain among a group of developers.

2) Standards mode produces a more reliable rendering of the content, which is important for cross user-agent compliance with regard to assistive technologies.

3) Code that is uniform and valid is easier for accessibility concerns.

4) Your code will have a far longer lifespan without conflict to future changes in the specification.


To add to austin's comment, there's a pretty good read over here about the differing modes: CSS - Quirks mode and strict mode

Yes, some of your markup will probably no longer be valid once you transition to standards mode. Developing under quirks mode targets older browsers that were programmed before CSS was accepted by Netscape and IE.

Since most browsers today are capable of rendering the W3C standards, I'd recommend targeting that as your goto mode. Sure it will be slightly painful now, but in the long run it is well worth it.


I don't know about your user base, but allowing the use of non-IE browsers - that count for over 35% of the global market - will surely please some of your customers. Using quirks mode almost forces your users to stick to IE.

At some point (probably in the distant future, though) IE will drop quirks mode, then you'll have to recode anyway. Better to do it now before your code grows beyond repair. Switching to a strict doctype now will save you development time as soon as you fix the initial problems.

I'd suggest trying the strict doctype and seeing what happens, and how broken the design is. Remember, the HTML doesn't have to be valid for strict mode to work. Font tags and alignment elements/attributes work fine in strict mode, though you should gradually phase them out and replace with CSS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜