【发布时间】:2021-10-15 07:26:06
【问题描述】:
我通过编辑在 Shopify 网站上工作。并且需要添加新的 css 文件。在 assets 中创建 style.css 文件并在 theme.liquid 文件中连接为
{{ 'style.css' | asset_url | stylesheet_tag }}.
我想知道我们可以添加新的 CSS 类吗?如果可以,我们该怎么做?
【问题讨论】:
标签: javascript css shopify
我通过编辑在 Shopify 网站上工作。并且需要添加新的 css 文件。在 assets 中创建 style.css 文件并在 theme.liquid 文件中连接为
{{ 'style.css' | asset_url | stylesheet_tag }}.
我想知道我们可以添加新的 CSS 类吗?如果可以,我们该怎么做?
【问题讨论】:
标签: javascript css shopify
您可以通过添加 . (period) 在 CSS 上编辑 class 的样式。例如,如果您的 HTML 包含 <div class="this">,您可以在 CSS 文件中对其进行编辑:
.this{
color: white;
}
或者你的意思是,你能在 HTML 文件中添加一个类吗?如果这就是你的意思,那么这个link 可以帮助你。您必须从富文本编辑器切换到 HTML 编辑器,如下图所示:
【讨论】:
你必须把它加进去
{
"type": "text",
"id": "section_css_class",
"label": {
"en": "Section CSS Class"
},
"default": {
"en": "Type your own CSS class"
}
},
和
<div class="page-width {{ section.settings.section_css_class }}">
【讨论】: