新网站使用哪种标记语言? (桌面和移动) [英] Which markup language to use for the new Web site? (Desktop & Mobile)

查看:99
本文介绍了新网站使用哪种标记语言? (桌面和移动)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要重新设计旧网站,并且正在考虑使用哪种最好的Web标记语言。这是我的两个问题。请帮助我找到正确的答案,以两者或任何人:


  1. 桌面用户的最佳Web标准是什么? HTML? XHTML?还要别的吗?它的什么版本(例如XHTML 1.0 Transitional)?

  2. 移动用户的最佳标记语言是什么?我要重新设计的网站是关于移动设备的应用程序。所以,我自然有很多移动访问者。大多数设备都是基于Android的,基于iOS的,以及一些黑莓,Palm OS和Symbian设备。我将在开发手机版网站时坚持使用哪种标记语言? 伟大的答案!

    解决方案

    我会避免使用XHTML。 XHTML已经成为一个死胡同,绝不比HTML更更好或更严格,再加上IE仍然不能正确支持它。参见例如: http://www.webdevout.net/articles/beware-of-xhtml



    目前最好的支持标准是HTML 4.01 Strict。



    不需要过渡您可以使用向后兼容的HTML5,因此可以使用HTML5 DOCTYPE 4.01标记,以便在您希望使用HTML5功能的情况下做好准备。 一段时间。请小心使用HTML5元素,因为IE不支持它们(或者甚至正确回退),除非您使用JavaScript解决方法。

    HTML5 DOCTYPE是<!DOCTYPE html> 。 HTML5具有两种语法风格,即HTML / SGML like类型和XHTML / XML类型(称为XHTML5)。两种类型都使用相同的DOCTYPE,但理论上对于XHTML语法是可选的,然而,浏览器将以快速模式呈现,这应该避免。浏览器根据文档的MIME类型区分两者,XHTML5必须为 application / xhtml + xml 。但IE不支持MIME类型,所以你不使用XHTML5。



    新的CSS3特性不应该有任何问题,如果你以某种方式使用它,那么该网站在未应用时不会变得无法使用。



    移动浏览器不需要任何特殊标记,因为它们全都支持HTML 4.01。查看CSS Media Queries,以便为移动浏览器显示不同的内容。



    根据内容的数量,可以为移动浏览器创建单独的网站移动浏览器不需要的任何内容,因此不需要下载,例如Flash。但是(再次)不需要任何针对移动浏览器的特殊HTML。


    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!

    解决方案

    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.

    这篇关于新网站使用哪种标记语言? (桌面和移动)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆