`& mdash;`或`—`HTML输出有没有什么区别? [英] `—` or `—` is there any difference in HTML output?

查看:327
本文介绍了`& mdash;`或`—`HTML输出有没有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

& mdash; 或—



这些有区别吗?是一种比另一种更好的支持?

解决方案

SGML解析器(或XHTML情况下的XML解析器)可以处理— ,而不必处理DTD(这对浏览器不重要,因为它们只是标签汤),而& mdash; 对于人类来说更容易在源代码中读写。



就我个人而言,我会坚持字面上的em-dash并确保我的角色编码设置是一致的。

— or —

Is there a difference between these? Is one better-supported than the other?

解决方案

SGML parsers (or XML parsers in the case of XHTML) can handle — without having to process the DTD (which doesn't matter to browsers as they just slurp tag soup), while — is easier for humans to read and write in the source code.

Personally, I would stick to a literal em-dash and ensure that my character encoding settings were consistent.

这篇关于`& mdash;`或`—`HTML输出有没有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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