> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participant-experiences/edit-your-widget-or-microsite-html-and-css-for-advocate.md).

# 为 Advocate 编辑你的组件或微站 HTML 和 CSS

你可以使用额外的 HTML 和 CSS 自定义 Advocate 小组件和微型网站，使其更贴合你的品牌形象。借助 Advocate 内置的 HTML 编辑器，你可以添加结构和样式，甚至覆盖某些默认组件，以实现更深入的自定义。

{% hint style="info" %}
**注意**：自定义 HTML/CSS 编辑功能仅适用于部分 Advocate 版本。请联系 [支持团队](mailto:saasquatch-support@impact.com) 升级账户并使用此功能。
{% endhint %}

#### 为什么要使用自定义 HTML 或 CSS？

自定义 HTML 和内联 CSS 可帮助你：

* 更贴合公司的品牌规范
* 调整布局和间距
* 应用默认编辑器不提供的样式
* 覆盖特定小组件或微型网站组件的样式

{% hint style="warning" %}
**重要提示**：对于自定义代码引发的问题，我们的支持团队只能提供有限协助。如果你不确定如何处理，建议联系 Advocate 实施团队或上线后支持团队。
{% endhint %}

#### 编辑 HTML 或 CSS

{% tabs %}
{% tab title="编辑微型网站" %}
你可以使用内置的 HTML 编辑器编辑 HTML 或 CSS，进一步自定义微型网站。HTML 编辑器让你能够更灵活地设计微型网站，但请注意，我们无法排查使用自定义 HTML 或 CSS 所做修改引发的问题。

1. 在左侧导航菜单中，选择 ![\[Engage\] v2](https://paligoapp-cdn-eu1.s3.eu-west-1.amazonaws.com/impact/attachments/f01cdffa431a4d75ff09c130b66974d4-aa671735ec2b65af79961eaf59ab60af.svg) **\[Engage] → 内容**.
2. 在微型网站卡片上，选择 **编辑内容**.
3. 在“微型网站”标签页中，选择要编辑代码的布局或页面。
4. 选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-3364b389815e6386c73528dda541e583d2fe0c16%2F0eceeaaa32f185a9932075cd699744ed6b755396902ea2e4cabff73869cb9f6f.svg?alt=media)![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-6104f36947b882897acb25b42d057dee1ebd572a%2F80d3875a58861553d70eb3df7d72c3e6820128c3d4212b3bb623e44832b6ee2c.svg?alt=media) **\[代码视图]** （位于顶部菜单栏）。
5. 根据需要添加或修改 HTML 和 CSS。
6. 可以通过以下三种方式添加 CSS：

   * 导入外部 CSS 样式表
   * 在页面顶部的 `<style>` 标签中：

   ```programlisting
   <style>
     p {
       color: blue;
     }

     .exampleClass {
       color: green;
       font-size: 25px;
       text-align: center;
     }

     #exampleId {
       color: red;
       font-size: 30px;
     }
   </style> 
   ```

   * 内联添加，以便为特定 HTML 元素应用样式：

   ```programlisting
   <h3 style="font-size:30px;color:blue;">Get rewarded when your friend uses our product</h3> 
   ```
7. 选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-1782d05738c13ec58eb6efb9c77d0c3e5ac96f02%2F309574593b8707c978ca25cd69a36a5a0faa4589103874c5ddc1dd96307e696e.svg?alt=media) **\[画笔]** 预览更改。
8. 选择 **保存草稿** 以保存，或选择 **发布** 以使更改上线。
   {% endtab %}

{% tab title="编辑小组件" %}
你可以使用内置的 HTML 编辑器编辑 HTML 或 CSS，进一步自定义小组件。HTML 编辑器让你能够更灵活地设计小组件，但请注意，我们无法排查使用自定义 HTML 或 CSS 所做的调整。

1. 在左侧导航菜单中，选择 ![\[Engage\] v2](https://paligoapp-cdn-eu1.s3.eu-west-1.amazonaws.com/impact/attachments/f01cdffa431a4d75ff09c130b66974d4-aa671735ec2b65af79961eaf59ab60af.svg) **\[Engage] → 内容**.
2. 在 *小组件* 卡片上，选择 **编辑小组件**.
3. 在 *计划小组件*下，选择要编辑的小组件。

<div data-with-frame="true"><figure><img src="https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fur4WJaahngh87vDtnZXg%2FScreenshot%202026-05-19%20at%2009.28.51.png?alt=media&amp;token=8f91133b-08f2-4c9b-9462-7e231dc80273" alt="" width="563"><figcaption></figcaption></figure></div>

1. 在顶部菜单栏中，选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-3364b389815e6386c73528dda541e583d2fe0c16%2F0eceeaaa32f185a9932075cd699744ed6b755396902ea2e4cabff73869cb9f6f.svg?alt=media)![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-6104f36947b882897acb25b42d057dee1ebd572a%2F80d3875a58861553d70eb3df7d72c3e6820128c3d4212b3bb623e44832b6ee2c.svg?alt=media) **\[方括号]**.
2. 在页面正文中添加或编辑 HTML。
3. 可以通过以下三种方式添加 CSS：

   * 导入外部 CSS 样式表
   * 在页面顶部的 `<style>` 标签中：

   ```programlisting
   <style>
     p {
       color: blue;
     }

     .exampleClass {
       color: green;
       font-size: 25px;
       text-align: center;
     }

     #exampleId {
       color: red;
       font-size: 30px;
     }
   </style> 
   ```

   * 内联添加，以便为特定 HTML 元素应用样式：

   ```programlisting
   <h3 style="font-size:30px;color:blue;">Get rewarded when your friend uses our product</h3> 
   ```
4. 选择 ![](https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-1782d05738c13ec58eb6efb9c77d0c3e5ac96f02%2F309574593b8707c978ca25cd69a36a5a0faa4589103874c5ddc1dd96307e696e.svg?alt=media) **\[画笔]** 预览更改。
5. 选择 **保存草稿** 以保存，或选择 **发布** 以使更改上线。
   {% endtab %}
   {% endtabs %}

#### **使用 CSS Parts 编辑组件**

小组件或微型网站中的某些内置组件无法通过可视化编辑器完全设置样式。在某些情况下，你可以使用 CSS Parts 覆盖其外观，从而进行更精细的控制。

如果你需要进行高级样式调整，impact.com 团队可以提供可行方案建议，并分享相关的 CSS Part 选择器。如果你有兴趣使用 CSS Parts 编辑组件，请联系你的倡导者实施团队或上线后支持团队。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participant-experiences/edit-your-widget-or-microsite-html-and-css-for-advocate.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
