简体   繁体   English

HTML / XHTML / XML代码在不同地区之间是否有所不同?

[英]Does HTML/XHTML/XML code differ across localizations?

This is a simple (and probably stupid) question, but across different localizations, does HTML, XHTML, or XML code remain the same as if I were typing it up on a system using the "en-us" localization? 这是一个简单的(可能是愚蠢的)问题,但是在不同的本地化中,HTML,XHTML或XML代码是否保持不变,就像我在使用“ en-us”本地化的系统上键入代码一样?

EG, if I have <strong>, <em>, and <font> tags that are generated for an HTML, XHTML or XML document (written on a system using the "en-us" locale, and someone tried to render the document using a system with the "sv-SE" locale, my understanding is that the tags should remain the same. Am I correct in assuming this? EG,如果我有为HTML,XHTML或XML文档生成的<strong>,<em>和<font>标记(使用“ zh-cn”区域设置在系统上编写,并且有人尝试呈现该文档使用具有“ sv-SE”语言环境的系统,我的理解是标签应该保持不变。

The code is currently generated using the WebBrowser control in the MSHTML namespace of .NET. 当前使用.NET的MSHTML命名空间中的WebBrowser控件生成代码。

Yes, it's the same everywhere, as the standard dictates the names of the tags and attributes. 是的,各地都一样,因为标准规定了标记和属性的名称。 It's the stuff in between the tags and the values of the attributes that would be localized. 这是标签和要本地化的属性值之间的内容。

If you are coding for HTML5, you can essentially define your own tags too. 如果您正在为HTML5编码,则实际上也可以定义自己的标签。

<div>Hello</div> = <stuff>Hello</stuff>

You just need to reference the element in your stylesheet: 您只需要引用样式表中的元素:

div { text-align: center; }
stuff {text-align: center; } 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM