# 隐藏详情中的投票

**URL:** https://meta.discourse.org/t/polls-within-hide-details/196150
**Category:** Support
**Tags:** hide-details
**Created:** [2021年七月6日 10:08 UTC](https://meta.discourse.org/t/polls-within-hide-details/196150 "2021-07-06T10:08:06Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2021年七月6日 11:23 UTC](https://meta.discourse.org/t/polls-within-hide-details/196150/2 "2021-07-06T11:23:15Z")

</div>

哦，我知道这个问题的答案。🙂

这是因为你需要将投票代码单独放在一行。你可以将 HTML 的隐藏详情标签与 Discourse 投票代码结合使用，以达到你想要的效果：

```plaintext

<details>
<summary>
隐藏投票
</summary>

[poll type=regular results=always chartType=bar]
* 选项 1
* 选项 2 
[/poll]

</details>

```

**示例：**

> **隐藏投票**
>
> _Poll ([view on site](https://meta.discourse.org/t/polls-within-hide-details/196150/2))_

* * *

**编辑：** 在我因发布第一条消息而兴奋不已之后，我回过头来查看了标准“隐藏详情”功能的表现，因为确实可以在投票上下方添加空白区域。

出于某种原因，它会将 `[/poll]` 和 `[/details]` 代码在末尾混合在一起。不知道这是否是预期行为，但如果你需要的话，上面的变通方法可以解决问题。👍

---

_[View the full topic](https://meta.discourse.org/t/polls-within-hide-details/196150)._
