# Responsive Video

**URL:** <https://forums.knack.com/t/responsive-video/8212>\
**Category:** Ask Developers\
**Created:** [April 9, 2021, 2:40pm UTC](https://forums.knack.com/t/responsive-video/8212 "2021-04-09T14:40:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abdelghani42247](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Abdelghani42247](https://forums.knack.com/u/Abdelghani42247)\
**Post date:** [April 9, 2021, 2:40pm UTC](https://forums.knack.com/t/responsive-video/8212/1 "2021-04-09T14:40:34Z")

</div>

Any CSS or JS ideas how to make Knack video embed responsive. I've tried many tricks and it did not work.  
Thanks

---

<div class="post-metadata">

**Author:** ![Abdelghani42247](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@Abdelghani42247](https://forums.knack.com/u/Abdelghani42247)\
**Post date:** [April 9, 2021, 6:34pm UTC](https://forums.knack.com/t/responsive-video/8212/2 "2021-04-09T18:34:13Z")

</div>

Hi Kelson,

Thank you for your quick response. What is the selectors position in the code?

---

<div class="post-metadata">

**Author:** ![Kelson](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/kelson/32/762_2.png) [@Kelson](https://forums.knack.com/u/Kelson)\
**Post date:** [April 9, 2021, 3:31pm UTC](https://forums.knack.com/t/responsive-video/8212/3 "2021-04-09T15:31:33Z")

</div>

Hi Abdelghani,&nbsp;  
  
Here is some code that has worked for me, be sure to change the selectors:

```
 function handleIFrameSize() {

    const actCard = Knack.$(".activityCard .activityInner");

    const actvCardSize = { w: actCard.innerWidth(), h: actCard.innerHeight() };

    Knack.$(".activityCard iframe").css({

      width: actvCardSize.w + "px",

      height: actvCardSize.w / 1.77 + "px",

    });

  }
```
