سؤال

If I make the doctype as:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

Can the page also use HTML5 features?

هل كانت مفيدة؟

المحلول

The documentation about the DOCTYPE indicates that

Authors should not use obsolete permitted DOCTYPEs, as they are unnecessarily long

so while it does say you can use it, it also says you shouldn't.

That being said, in my experience modern browsers don't seem to care much about the doctype (even if you omit it). You should still be able to use any HTML5 "features" with them including new semantic tags, new JS additions, etc., but just note that it is not advisable.

نصائح أخرى

According to the HTML5 specification, you can add some additional information into DOCTYPE: http://www.w3.org/TR/html51/syntax.html#the-doctype

Optionally, a DOCTYPE legacy string or an obsolete permitted DOCTYPE string (defined below).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top