propiedad height HTML DOM IFrame
Frame / objetos IFrame
Definición y Uso
conjuntos de propiedades de altura o devuelve el valor del atributo altura del elemento iframe.
atributo de altura iframe especifica la altura (en píxeles o como un porcentaje).
gramática
iframeObject.height=value
atributo de altura puede tener los siguientes valores:
值 | 描述 |
---|---|
pixels | height 属性单位可以是像素 (如 "100px" 或者 "100") |
% | height 属性单位可以是百分比 (如"20%") |
Soporte para el navegador
Todos los principales navegadores soportan atributo de altura
Ejemplos
Ejemplos
Cambiar el alto y el ancho de marco flotante:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function changeSize(){
document.getElementById("myframe").height="300";
document.getElementById("myframe").width="300";
}
</script>
</head>
<body>
<iframe id="myframe" src="http://www.w3big.com" height="200" width="200">
<p>你的浏览器不支持iframes。</p>
</iframe>
<br><br>
<input type="button" onclick="changeSize()" value="修改大小">
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function changeSize(){
document.getElementById("myframe").height="300";
document.getElementById("myframe").width="300";
}
</script>
</head>
<body>
<iframe id="myframe" src="http://www.w3big.com" height="200" width="200">
<p>你的浏览器不支持iframes。</p>
</iframe>
<br><br>
<input type="button" onclick="changeSize()" value="修改大小">
</body>
</html>
Trate »
Frame / objetos IFrame