English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <iframe> width Attribute

Dieser Artikel beschreibt, wie man die Breite eines <iframe> in HTML mit Pixeln angibt und zeigt mit Online-Beispielen, wie man den HTML iframe width-Attribute, die Kompatibilität der Browser, die Syntaxdefinition und die detaillierten Informationen zu seinen Attributwerten verwendet.

 HTML <iframe> Tag

Online-Beispiel

festgelegte Höhe480-Pixel, Breite von280-Pixel-<iframe>:

<!DOCTYPE html>
<html>
<head>
<title>HTML:<iframe> width Attribute - Basic Tutorial Website oldtoolbag.com</title>
<body>
<iframe src="/" width="480" height="280">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the width attribute.

Definition and Usage

The width attribute specifies the width of the <iframe> in pixels.

HTML 4.01 and HTML5Difference between

In HTML 4.01In, the width can be defined in pixels or as a percentage of the containing element. In HTML5In, this value must be specified in pixels.

Syntax

<iframe width="pixels">

Attribute Value

ValueDescription
pixelsWidth in pixels (for example "200px" or just "200")。
 HTML <iframe> Tag