# IFrame CSS Code - Disable Scrolling Bar

**URL:** https://meta.discourse.org/t/iframe-css-code-disable-scrolling-bar/83254
**Category:** Support
**Created:** [March 18, 2018, 7:27pm UTC](https://meta.discourse.org/t/iframe-css-code-disable-scrolling-bar/83254 "2018-03-18T19:27:00Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [September 1, 2020, 7:20pm UTC](https://meta.discourse.org/t/iframe-css-code-disable-scrolling-bar/83254/13 "2020-09-01T19:20:03Z")

</div>

Ah yes, things have definitely changed a bit since then! Below I’ve included a targeted example based on our currently preferred decoration method.

The following code will need to be added to the `</head>` tag of a theme/component:

```plaintext
<script type="text/discourse-plugin" version="0.8.42">
  api.decorateCookedElement(post =>
    post.querySelectorAll('div[data-theme-iframe="no-scroll"] iframe').forEach(iframe => {
      iframe.setAttribute('scrolling', 'no');
    }),
    { 
      id: 'iframe-decorator',
      onlyStream: true,
    }
  );
</script>

```

With the above in place, you can wrap an iframe with a specific `div` like so to disable the scroll within a post:

```plaintext
<div data-theme-iframe="no-scroll">
  <iframe src="https://someallowediframesource.com"></iframe>
</div>

```

That should do the trick, but let me know if you find any issues with it.

---

_[View the full topic](https://meta.discourse.org/t/iframe-css-code-disable-scrolling-bar/83254)._
