Skip to content

Commit

Permalink
init docs for {HTMLEmbedElement,HTMLIFrameElement}.{width,height} (#3…
Browse files Browse the repository at this point in the history
…1701)

* add docs

* fix links

* add example

* update desc

* update value
  • Loading branch information
skyclouds2001 authored Jan 22, 2024
1 parent 61ab1d0 commit b63cdd8
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 0 deletions.
40 changes: 40 additions & 0 deletions files/en-us/web/api/htmlembedelement/height/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "HTMLEmbedElement: height property"
short-title: height
slug: Web/API/HTMLEmbedElement/height
page-type: web-api-instance-property
browser-compat: api.HTMLEmbedElement.height
---

{{APIRef("HTML DOM")}}

The **`height`** property of the {{domxref("HTMLEmbedElement")}} interface returns a string that reflects the `height` attribute of the {{HTMLElement("embed")}} element, indicating the displayed height of the resource in CSS pixels.

## Value

A string indicating the displayed height of the resource in CSS pixels.

## Examples

```html
<embed id="el" width="800" height="600" />
```

```js
const el = document.getElementById("el");
console.log(el.height); // Output: '600'
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLCanvasElement.height")}}
- {{domxref("HTMLImageElement.height")}}
- {{domxref("HTMLObjectElement.height")}}
40 changes: 40 additions & 0 deletions files/en-us/web/api/htmlembedelement/width/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "HTMLEmbedElement: width property"
short-title: width
slug: Web/API/HTMLEmbedElement/width
page-type: web-api-instance-property
browser-compat: api.HTMLEmbedElement.width
---

{{APIRef("HTML DOM")}}

The **`width`** property of the {{domxref("HTMLEmbedElement")}} interface returns a string that reflects the `width` attribute of the {{HTMLElement("embed")}} element, indicating the displayed width of the resource in CSS pixels.

## Value

A string indicating the displayed width of the resource in CSS pixels.

## Examples

```html
<embed id="el" width="800" height="600" />
```

```js
const el = document.getElementById("el");
console.log(el.width); // Output: '800'
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLCanvasElement.width")}}
- {{domxref("HTMLImageElement.width")}}
- {{domxref("HTMLObjectElement.width")}}
40 changes: 40 additions & 0 deletions files/en-us/web/api/htmliframeelement/height/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "HTMLIFrameElement: height property"
short-title: height
slug: Web/API/HTMLIFrameElement/height
page-type: web-api-instance-property
browser-compat: api.HTMLIFrameElement.height
---

{{APIRef("HTML DOM")}}

The **`height`** property of the {{domxref("HTMLIFrameElement")}} interface returns a string that reflects the `height` attribute of the {{HTMLElement("iframe")}} element, indicating the height of the frame in CSS pixels.

## Value

A string indicating the height of the frame in CSS pixels.

## Examples

```html
<iframe id="el" width="800" height="600"></iframe>
```

```js
const el = document.getElementById("el");
console.log(el.height); // Output: '600'
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLCanvasElement.height")}}
- {{domxref("HTMLImageElement.height")}}
- {{domxref("HTMLObjectElement.height")}}
40 changes: 40 additions & 0 deletions files/en-us/web/api/htmliframeelement/width/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "HTMLIFrameElement: width property"
short-title: width
slug: Web/API/HTMLIFrameElement/width
page-type: web-api-instance-property
browser-compat: api.HTMLIFrameElement.width
---

{{APIRef("HTML DOM")}}

The **`width`** property of the {{domxref("HTMLIFrameElement")}} interface returns a string that reflects the `width` attribute of the {{HTMLElement("iframe")}} element, indicating the width of the frame in CSS pixels.

## Value

A string indicating the width of the frame in CSS pixels.

## Examples

```html
<iframe id="el" width="800" height="600"></iframe>
```

```js
const el = document.getElementById("el");
console.log(el.width); // Output: '800'
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- {{domxref("HTMLCanvasElement.width")}}
- {{domxref("HTMLImageElement.width")}}
- {{domxref("HTMLObjectElement.width")}}

0 comments on commit b63cdd8

Please sign in to comment.