【发布时间】:2019-10-15 05:00:50
【问题描述】:
感谢您的帮助。如何使所有 HTML 属性(即单词 type=)在 VSCode 中斜体?是否可以?我的意思是想换个主题。您知道某些主题如何具有斜体属性吗? type=, class=, id=, 我只是想让这些家伙在主题中用斜体显示。
【问题讨论】:
标签: html attributes
感谢您的帮助。如何使所有 HTML 属性(即单词 type=)在 VSCode 中斜体?是否可以?我的意思是想换个主题。您知道某些主题如何具有斜体属性吗? type=, class=, id=, 我只是想让这些家伙在主题中用斜体显示。
【问题讨论】:
标签: html attributes
VS Code 的syntax color themes 可以指定fontStyle 除了语法范围的颜色。要使文本斜体,您需要设置"fontStyle": "italic"
这个例子editor.tokenColorCustomizations setting使用fontStyle使一些html属性斜体:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "entity.other.attribute-name",
"settings": {
"fontStyle": "italic"
}
}
]
}
这是example of how to set fontStyle in an actual color theme。
entity.other.attribute-name 只是一个示例范围。您可能需要根据您的特定需求调整范围或设置多个范围的样式
【讨论】:
你可以使用标签<i>inert italicized content here</i>例子:
`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
</head>
<body>
<i>this stuff is italicized</i>
</body>
</html>`
另一个很好的标签是<em></em>,用来强调标签。 Here's a great website I like to use.
编辑:here
【讨论】: