Search code examples
ioscsswidgetbordersoundcloud

Is there anything I can do to remove the 1px border appearing around this SoundCloud widget?


As you can see , there is a 1px border around the widget. It only appears on iOS. I can see the CSS that's causing this in the inspector:

.widget {
  ...
  border: 1px solid #e5e5e5;
  ...
}

This is the iframe:

<iframe src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/307068209&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;visual=true" scrolling="0" frameborder="0"></iframe>

I know CSS can't effect elements coming from a different domain in an iframe, but client says it looks bad. Is there something that I might be doing to cause this to appear? If not, is there a way I can remove this?


Solution

  • I ended up taking advice from this post:

    CSS: Inset shadow by parenting div over iframe

    And added this bad boy:

    .iframe-wrapper:before{
      position: absolute;
      content: '';
      top: 0;
      left: 0;
      box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, .4) inset;
      z-index: 1;
      width: 100%;
      height: 100%;
    }
    

    Which hides the border well enough