how to leave an embed with fixed width and height responsive?

1

Does anyone know how to leave this embed responsive, I can not because after a fixed width and height?

<iframe src="//vshare.io/v/f171731/width-470/height-305/" width="470" height="305" frameborder="0" scrolling="no" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe> <p>
    
asked by anonymous 26.10.2017 / 14:25

2 answers

-1

could create a class that would contain the embed, and set the value it wants (height and width) would then put overflow: hidden, and in embed, would place it centralized in the parent div. I know that is not the best way, because it would cut part of the embed, but there is another way that is to change in the element by line style (that <embed style="width: tal; height: tal;"> ), online because it is what will not undergo external changes, directly on site

    
26.10.2017 / 22:15
-1

You can use embed-responsive if you're using bootstrap or this css:

.videoWrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  padding-top: 25px;
  height: 0;
}

.videoWrapper object,
.videoWrapper embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

Following this idea you will use:

<div class="videoWrapper"><embed ...>
    
26.10.2017 / 21:55