0
votes

I have used an image with <object> tag. But some larger image showing scrollbar in it.

I need to set the image width to 100px width, so how can we edit the shadow element inside the <object> tag?

Tried width="100" to the <object> but showing image width is more than object tag.

Here is the code:

<object data="//via.placeholder.com/645x400" aria-label="logo" type="image/svg+xml" ></object>
1
This is impossible as this image is called from another page via object. - en0ndev
Is there a specific reason to use <object> instead of <img>? - Nico Shultz
@NicoShultz yes.. something regarding fast loading - vishnu
@vishnu are you sure about that? I mean it still loads a img element just inside its own document - Nico Shultz

1 Answers

-2
votes

the problem is you are using the generated image and it says the image must be 645 x 400

please use the below code. I have set the image width and height to 100 x 100 .. check the URL

<object data="//via.placeholder.com/100x100" aria-label="logo" type="image/svg+xml" ></object>

please check the below code pen to get more idea

https://codepen.io/subodha-the-selector/pen/dypEYoe