html - How can I make an iframe inside of a <td> 33 percent of the screen width? -


i have frame inside of <td> element. i'd dynamically scale iframe takes 33% of screen width (and automatically fixes height).

when try this:

<iframe src="google drive presentation url" frameborder="0" width="33vw" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe> 

it takes 33% of <td> element (which has text in it).

also, tried using width="33%" didn't work either.

how can fix this?

you must give width using css instead.

body {    margin: 0  }  td {    width: 33.3%;    background: red  }  iframe {    width: 100%  }
<table>    <tr>      <td>        <iframe src="google drive presentation url" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>      </td>      <td>        foo bar      </td>      <td>        foo bar      </td>    </tr>  </table>


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -