我目前在Twine做一个项目,并使用Sugarcube格式。我无法弄清楚如何使用CSS设置单个段落的样式。我已经尝试在CSS中创建类,然后使用该类的名称标记一个段落,但它不起作用。
SugarCube documentation列出了许多基于通道标签设置通道样式的方法。因此,如果您使用“森林”标记了一个段落,则会给出以下示例:
→ Using class selectors on <body>
body.forest { background-image: url(forest-bg.jpg); }
body.forest .passage { color: darkgreen; }
body.forest a { color: green; }
body.forest a:hover { color: lime; }
→ Using [data-tag~="…"] attribute selectors on <body>
body[data-tag~="forest"] { background-image: url(forest-bg.jpg); }
body[data-tag~="forest"] .passage { color: darkgreen; }
body[data-tag~="forest"] a { color: green; }
body[data-tag~="forest"] a:hover { color: lime; }
→ Using [data-tag~="…"] attribute selectors on <html>
html[data-tag~="forest"] { background-image: url(forest-bg.jpg); }
html[data-tag~="forest"] .passage { color: darkgreen; }
html[data-tag~="forest"] a { color: green; }
html[data-tag~="forest"] a:hover { color: lime; }
确保将您使用的CSS放在故事的样式表部分中。