html - 使用字体系列转义引用

标签 html css fonts

我想使用 font-family CSS

<div style="font-family:"Times New Roman", Times, serif"> Hello world! </div>

对于字体系列“Times New Roman”,我应该转义引号吗?或者我可以不带引号使用它吗?

最佳答案

使用单引号:

<div style="font-family: 'Times New Roman', Times, serif"> Hello world! </div>

或者(感谢 @Matt):

<div style='font-family: "Times New Roman", Times, serif'> Hello world! </div>

关于html - 使用字体系列转义引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16493394/

相关文章:

javascript - 如何使用纯 JavaScript 清除 Microsoft VirtualEarth 6.3 中的整个形状层?

html - 重叠 "Zoom"div 阻塞文本和选项选择

Jquery UI 位置插件不适用于 margin 属性

javascript - 使用这个系统来布局网页有什么潜在的问题?

ios - 如何检查 UIFont 是否为系统字体?

java - 如何提供关闭 Internet Explorer 窗口的确认?

php - 将超链接转换为按钮

html - 如何用html改变标题中的文字大小

css - 获得好的@font-face 字体

ios - 使用字体样式和字体大小复制自定义字体