维度中“x”的正确 HTML 实体是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12009545/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the proper HTML entity for the "x" in a dimension?
提问by Nick
Is the proper HTML entity for giving dimensions ×
? I want to be semantically correct, but that begs the question, is listing a dimension as 2" x 3"
even semantic? If the xrepresents "by", would I use the letter x or ×?
是用于给出尺寸的正确 HTML 实体×
吗?我想在语义上是正确的,但这引出了一个问题,是否将维度列为2" x 3"
偶数语义?如果x代表“by”,我会使用字母 x 还是 ×?
In my code I've been using 2″ × 3″
, or 2″ × 3″. The non-breaking spaces are to prevent the dimension from being wrapped, as per the suggestions found in The Elements of Typographic Style Applied to the Web.
在我的代码中,我一直使用2″ × 3″
, 或 2" × 3"。根据The Elements of Typographic Style Applied to the Web 中的建议,不间断空格是为了防止维度被包裹。
回答by unor
×
×
- Unicode:
U+00D7 MULTIPLICATION SIGN
- HTML:
×
,×
- CSS:
\00d7
- 统一码:
U+00D7 MULTIPLICATION SIGN
- HTML:
×
,×
- CSS:
\00d7
See the Wikipedia article about the multiplication sign:
请参阅有关乘法符号的维基百科文章:
In mathematics, the symbol × (read as times or multiplied by) is primarily used to denote the […]
- Geometric dimension of an object, such as noting that a room is 10×12 feet in area.
在数学中,符号 ×(读作时间或乘以)主要用于表示 […]
- 对象的几何尺寸,例如注意房间的面积为 10×12 英尺。
Depending on the context, the math
element(for MathML) element could be of use.
回答by Jukka K. Korpela
The proper question is which charactershould be used. The use of entity references for characters adds no semantics. There is no formal standard on denoting dimensions, but clearly this is about multiplication rather than the Latin letter x, so “x” (×
) is the correct character.
正确的问题是应该使用哪个字符。对字符使用实体引用不会增加语义。没有关于表示维度的正式标准,但很明显这是关于乘法而不是拉丁字母 x,所以“x” ( ×
) 是正确的字符。
In practice, this is more of an orthography and typography question than about “semantic web”. Search engines, browsers, etc., don't really care; it's the human readers that matter.
在实践中,这更像是一个拼写和排版问题,而不是“语义网”。搜索引擎、浏览器等,并不真正关心;重要的是人类读者。
回答by Kryzhovnik
You're doing everything correctly. I believe × here is [semantically] related to the operation of multiplication, i.e. in fact you write the area by specifying two dimensions.
你做的一切都是正确的。我相信 × 这里 [语义上] 与乘法运算有关,即实际上您通过指定两个维度来写区域。