A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/html-object-width-attribute below:

HTML <object> width Attribute - GeeksforGeeks

HTML <object> width Attribute

Last Updated : 12 Jul, 2025

The HTML <object> width attribute is used to specify the horizontal dimension of the embedded object, defining the width of the displayed content within the webpage.

Syntax:

<object width="pixels">

Attribute Values:

The below example illustrates the <object> width attribute in HTML:

HTML <object> width attribute Example

Example: This example uses object width attribute to set the object width.

HTML
<!DOCTYPE html>
<html>
    <head>
        <title>HTML object width Attribute</title>
    </head>
    <body style="text-align: center">
        <h2>HTML object width Attribute</h2>
        <object
            id="myobject"
            width="400"
            height="200"
            data=
"https://media.geeksforgeeks.org/wp-content/uploads/geek-8.png"
         >
        </object>
    </body>
</html>

Output:

Explanation:

HTML object width attribute Use-Case 1. How to specify the width and height of the object in HTML5?

In HTML5, use the width and height attributes within the <object> tag to specify the horizontal and vertical dimensions of embedded content, respectively, defining its display size.

Supported Browsers

The browser supported by HTML <object> width attribute are listed below:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4