Which markup language to use for the new Web site?

2019-08-06 05:43发布

I need to redesign the old site and was thinking what would be the best Web markup language to use. Here are my two questions. Please help me to find the right answer to both or any of them:

  1. What's the optimal Web standard for desktop users? HTML? XHTML? Anything else? What version of it (e.g. "XHTML 1.0 Transitional")?

  2. What is the optimal markup language for mobile users? The site I'm going to redesign is about applications for mobile devices. So, naturally I have a lot of mobile visitors. Most of the devices are Android-based, iOS-based as well as some BlackBerries, Palm OS and Symbian devices. Which markup language should I stick to when I'll be developing mobile version of the site?

Thanks as always for the great answers!

4条回答
欢心
2楼-- · 2019-08-06 06:11

I would avoid XHTML. XHTML has become a dead end and is in no way "better" or "stricter" than HTML, plus IE still doesn't support it properly. See for example: http://www.webdevout.net/articles/beware-of-xhtml

The best supported standard currently is HTML 4.01 Strict.

There is no need for transitional for a newly created site.

You could use "backwards compatible HTML5", thus 4.01 markup with the HTML5 DOCTYPE, in order to be ready if you want to use HTML5 features some time. Be careful with HTML5 elements, because IE doesn't support them (or even fall back properly), unless you use a JavaScript work-around.

The HTML5 DOCTYPE is <!DOCTYPE html>. HTML5 comes in two syntax flavors, the "HTML/SGML like" kind and the "XHTML/XML" kind (called "XHTML5"). Both kinds use the same DOCTYPE, but it is theoretically optional for the "XHTML" syntax, which however will have browsers render in quicks mode, which should be avoided. The browser distinguishes between the two by the MIME type of the document, which MUST be application/xhtml+xml for XHTML5. But IE doesn't support that MIME type, so you not use XHTML5.

New CSS3 features shouldn't make any problems, if you use it in a way, so that the site doesn't become unusable when not applied.

There is no need for any special markup for mobile browsers as they all support HTML 4.01 quite fine. Look into CSS Media Queries to display the content differently for mobile browsers.

Depending on the amount of content, it however may make sense to create a separate site for mobile browsers without any content that mobile browsers doesn't need, so it doesn't need to be downloaded, such as Flash. But (again) there is no need for any "special" HTML for mobile browsers.

查看更多
\"骚年 ilove
3楼-- · 2019-08-06 06:24

if you want to follow standards you should use XHTML 1.0 Transitional for web and for mobil web xhtml mobile. Having said that modern desktop and mobile browsers would parse html without any doctype.

查看更多
叛逆
4楼-- · 2019-08-06 06:29

I also recommend you not to use XHTML, even XHTML 1.0 Transitional, we know it is more stricter than the HTML but the W3 has made the XHTML dead, no more alive. Many of the modern browsers are using it as a plain HTML/Text and are ignoring it. It's better to say goodbye to the XHTML and welcome to HTML. Use HTML 4(any version) or HTML 5 which is a stricter version of HTML and comprises both the rules of HTML and XHTML. I hope it helped you.

查看更多
甜甜的少女心
5楼-- · 2019-08-06 06:30

For "desktop" viewing of a website I'd recommend using HTML5. - This is for the basic doctype. Avoid using new tags and features of CSS3 which don't have support for the majority of your users. (In that you have an exisitng site I'm assuming you have analytics to tell you this.)

For the "mobile" version I'd use HTML Mobile Profile.

The combination of these two will give you largest reach for the smallest number of doctypes.

查看更多
登录 后发表回答