问题
I think I should use <!DOCTYPE html>
for my new GWT application; I understand that doing so will put my application into standards-compliant mode. Am I correct? Are there any disadvantages to using this doctype? Does GWT work properly in standards-compliant mode? I'm wary because the GWT tutorial still uses the HTML 4.01 transitional doctype.
回答1:
The new layout panel functionality in GWT 2.0 requires standards mode and does not work in quirks mode.
回答2:
Using <!DOCTYPE html>
will put the web browser into standards mode (as opposed to quirksmode) which is almost certainly what you want. But the HTML 4.01 Transitional doctype will also trigger standards mode, so there's no difference there.
I've no idea of the implications of using one or the other with GWT - but I doubt there are any advantages to using the HTML5 doctype to be honest, unless GWT is doing special things to support HTML5.
来源:https://stackoverflow.com/questions/2641866/which-doctype-should-i-use-for-gwt-2-0