English 中文(简体)
是否需要在社会保障局中用老姓打字?
原标题:Do I need to wrap quotes around font family names in CSS?

我记得很久以前曾听说过,在《社会保障法》中包含多字的字面名字上,“最佳做法”被认为是“最佳实践”,例如:

font-family: "Arial Narrow", Arial, Helvetica, sans-serif;

就其舱面而言,我试图从“Arial Narrow”上删除引语,Safat和Sotherine t对此没有任何问题。

因此,这条规则是否有任何逻辑,还是只是一个神话? 是否与旧浏览器的问题不再适用于目前版本? 长期以来,我一直在这样做,我从未停止思考,如果实际需要的话。

最佳回答

http://www.w3.org/TR/CSS2/fonts.html#font-family-prop” 告诉我们:

Font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. This means most punctuation characters and digits at the start of each token must be escaped in unquoted font family names.

It goes on to say:

If a sequence of identifiers is given as a font family name, the computed value is the name converted to a string by joining all the identifiers in the sequence by single spaces.

To avoid mistakes in escaping, it is recommended to quote font family names that contain white space, digits, or punctuation characters other than hyphens:

确实,存在分歧,但不可能造成任何问题。 在我个人方面,我总是在有空位时引用假名。 在少数(通常非常少见)案件中,绝对需要援引:

Font family names that happen to be the same as a keyword value ( inherit , serif , sans-serif , monospace , fantasy , and cursive ) must be quoted to prevent confusion with the keywords with the same names. The keywords initial and default are reserved for future use and must also be quoted when used as font names.

Also note that punctuation such as / or ! within an identifier may also need to be quoted or escaped.

问题回答

According to the CSS Fonts Module Level 3 spec of October 2013, "font family names other than generic families must either be given quoted as strings, or unquoted as a sequence of one or more identifiers". So you DO NOT need to enclose them in quotes.

然而,如果你不“在每一条条条条条条条条条条条条开始时,必须先从中删除。 为避免 escaping误,W3C实际上建议引用含有白色空间、数字、图解或关键词值的字体姓氏:(`'`````'',“serif''等)。

The general font family name (`aserif', "sans-serif', "cursive', "fantasy', and "monospace') MUST NOT被引用,因为它们实际上是关键词。

如果风格一致,如:<font风格=“font-family:Arial Narrow”>有些文字与设计;/font>,则行文。

但是,如果警察的名词含有一些特殊性,或者从若干人开始含有一些引语或其他杂质(如“01数字l”或“a_CityNovaTitulB&WLt”或“Bailey sCar”),那么你必须使用一种特殊合成物,其名称为&“<>>>>,可适用于各种平方名:

<font style="font-family:&quot;a_CityNovaTitulB&WLt&quot; , &quot;Bailey sCar&quot;">some text</font>

In FireFox,the source will show the &quot; as this: "

如果没有这一骗局,情况如下:

<font style="font-family:a_CityNovaTitulB&WLt ,Bailey sCar">some text</font>

doesn t automatically work in every browser. It s useful for font name witch start by a number to, like "8 Pin".





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...

热门标签