CSS 如何在wix网站中添加自定义css
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49877549/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to add custom css in wix website
提问by Ravi Singh
I am new at wix and editing a website and want to add css in a page. but not found any option for css. Anybody know how to add custom css code in wix website?
我是 wix 和编辑网站的新手,想在页面中添加 css。但没有找到任何 css 选项。有人知道如何在 wix 网站中添加自定义 css 代码吗?
Thanks
谢谢
回答by Gray Ayer
You can do this by embedding inline styles to every page, via creating a chunk of custom css code contained between <style>
and </style>
.
您可以通过将内联样式嵌入到每个页面来实现此目的,方法是创建包含在<style>
和之间的自定义 css 代码块</style>
。
- Go to your site's dashboard.
- Click?Manage Website?on the left.
- Click?Tracking & Analytics.
- Click?+ New Tool?**and select?**Custom?from the dropdown.
- Set up your custom code:
- Enter your custom code.
- Select the relevant domain. Note:?This option will appear only if you have multiple domains.
- Enter a name for your custom code.
- Add Code to Pages:?Select which pages to add your code to:
- **All Pages:?**Click the dropdown to select an option:
- Load code once.
- Load code on each new page.
- **Choose specific pages:?**Begin typing the name of the relevant pages and then click the checkbox next to the relevant page.
- **All Pages:?**Click the dropdown to select an option:
- Place Code in:?Select where the code snippet in placed in your site's code:
- Head- as noted by @Daniel Gurtner, avoid this because it'll insert it BEFORE any of the inherent styles, which makes it mostly useless here.
- Body - start
- Body - end Note:?I'd recommend adding your style chunk here to avoid having a delay effect on your loading
- Click?Apply.
- 转到您网站的仪表板。
- 点击?管理网站?在左边。
- 点击?跟踪与分析。
- 点击?+ 新工具?**并从下拉菜单中选择?**自定义?
- 设置您的自定义代码:
- 输入您的自定义代码。
- 选择相关域。注意:? 仅当您有多个域时才会出现此选项。
- 输入自定义代码的名称。
- 向页面添加代码:?选择要将代码添加到哪些页面:
- **所有页面:?**单击下拉菜单以选择一个选项:
- 加载一次代码。
- 在每个新页面上加载代码。
- **选择特定页面:?**开始输入相关页面的名称,然后单击相关页面旁边的复选框。
- **所有页面:?**单击下拉菜单以选择一个选项:
- 放置代码:?选择代码片段在您网站代码中的位置:
- Head- 正如@Daniel Gurtner 所指出的,避免这种情况,因为它会在任何固有样式之前插入它,这使得它在这里几乎没有用。
- 身体 - 开始
- 正文 - 结束注意:?我建议在此处添加您的样式块以避免对您的加载产生延迟影响
- 点击?申请。
回答by Garry
- Click Addon the left in the editor.
- Click More→ Embeds.
- Drag the HTML iframe to the site.
- Click your iframe and click Edit Code.
Then type:
<style> /* CSS Code */ </style>
- 单击Add编辑器左侧的 。
- 单击More→ 嵌入。
- 将 HTML iframe 拖到站点。
- 单击您的 iframe,然后单击Edit Code。
然后输入:
<style> /* CSS Code */ </style>