# iFrame 배경색이 작동하지 않음

**URL:** <https://meta.discourse.org/t/background-color-of-iframe-not-working/232916>\
**Category:** Support\
**Created:** [7월 14, 2022, 9:48오후 UTC](https://meta.discourse.org/t/background-color-of-iframe-not-working/232916 "2022-07-14T21:48:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![SaraDev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saradev/32/335139_2.png) [@SaraDev](https://meta.discourse.org/u/SaraDev)\
**Post date:** [7월 14, 2022, 11:03오후 UTC](https://meta.discourse.org/t/background-color-of-iframe-not-working/232916/2 "2022-07-14T23:03:04Z")

</div>

Discourse에서는 기본적으로 모든 게시물에서 스타일/클래스가 제거되므로, iframe에 사용자 지정 배경색을 설정하려면 사용자 지정 CSS를 사용해야 할 가능성이 높습니다.

> [@게시물 내 사용자 정의 CSS / 사용자 정의 클래스 추가](https://meta.discourse.org/t/custom-css-inside-a-post-adding-custom-classes/143072):
>
> Is it possible to give a \<div\> inside a post some custom styling? I’ve [seen](https://meta.discourse.org/t/adding-custom-class-to-img-tag/21425/7) that any non-whitelisted classes are stripped out, and I’ve tried addingstyle= to my divs and spans to no avail , so does anyone know if there’s a way to do that? Basically I have a bot that posts from an internal tool and I’d like to have it post with something that looks like the tool to make it obvious that it’s not a regular disourse post, something like this: It’s got a couple of nested divs/spans to ma…

예를 들어, 주제 내에서 다음과 같이 사용할 수 있습니다:

```plaintext
<div data-theme-1>
<iframe width="100%" height="300" src="https://dune.com/embeds/1002945/1734962/fe28df65-99a3-4b98-8cb4-e97f132c8165" frameborder="0"></iframe>
</div>

```

그리고 사용하는 테마의 사용자 지정 CSS에 다음을 추가하십시오:

```plaintext
div[data-theme-1] {
  background-color: #FFFFFF;
}

```

사이트에서 스타일/클래스를 화이트리스트에 추가하는 것에 관심이 있다면, 이는 플러그인을 통해 수행해야 합니다.

> [@게시물 내부 콘텐츠를 커스터마이징하는 방법 (커스텀 속성 등)](https://meta.discourse.org/t/what-are-the-different-ways-to-customize-content-inside-a-post-custom-attributes-and-such/226747/5?u=alexdev):
>
> It is possible to uses some HTML classes in Discourse, however, most HTML in a post is sanitized for security reasons, and only very strict whitelisted HTML is allowed in markdown. To add classes to the white-list you must use a plugin, the sanitization happens server side as well as client side. Check out [Whitelisting HTML tags / attributes](https://meta.discourse.org/t/whitelisting-html-tags-attributes/159653) for some details on where to add the whitelisted attributes, and I believe it would look similar to something like this: [Discourse HTML Whitelist](https://github.com/pnewell/discourse-html-whitelist). and a…

---

_[View the full topic](https://meta.discourse.org/t/background-color-of-iframe-not-working/232916)._
