Embed image in a button element

0 votes
I'm attempting to use an HTML element to display a PNG image. It is impossible to see the entire image because the button is the same size as the image and the image is shown but not in the center for some reason. In other words, it appears like the top right corner of the image is situated in the button's center rather than in the button's top right corner.

The HTML code is as follows:

What truly occurs, in my opinion, is a margin issue. The background image is leaving the button since I receive a two-pixel margin. Since the button and the image are exactly 20 px in size, it is quite noticeable. I attempted padding:0 and margin:0
Jul 21, 2022 in HTML by Ashwini
• 5,430 points
166 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In HTML

0 votes
0 answers

how to create a HTML5 video element without it being shown in the page?

how is it possible to dynamically create ...READ MORE

Jul 5, 2022 in HTML by Tejashwini
• 3,820 points
266 views
0 votes
0 answers

Inputting a default image in case the src attribute of an html <img> is not valid?

Is there any way to render a ...READ MORE

Jul 8, 2022 in HTML by Tejashwini
• 3,820 points
367 views
0 votes
0 answers

Inputting a default image in case the src attribute of an html <img> is not valid?

In the event that the src property ...READ MORE

Jul 12, 2022 in HTML by Ashwini
• 5,430 points
259 views
0 votes
0 answers

How to embed a PDF viewer in a page?

If I'm not mistaken, Google Docs provides ...READ MORE

Jul 26, 2022 in HTML by Ashwini
• 5,430 points
266 views
0 votes
1 answer

How to Identify Web Element( Button) when there are multiple buttons without any ID

Hi Gangadhar, Do you need the HTML code to ...READ MORE

answered Feb 10, 2020 in HTML by Roshni
• 10,520 points
1,249 views
0 votes
0 answers

How to do calculation in PHP using a csv file for retrieving data?

Morning, I have a csv file and i ...READ MORE

Feb 11, 2020 in HTML by anonymous
• 140 points
1,247 views
0 votes
1 answer

Render HTML to an image

To answer your question, there are a ...READ MORE

answered Feb 8, 2022 in Java by Soham
• 9,700 points
1,556 views
0 votes
1 answer

seo - images and h1

SEO is speculative at best. Generally, the accepted ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 63,420 points
546 views
0 votes
0 answers

When to use IMG vs. CSS background-image?

In what situations is it more appropriate ...READ MORE

Mar 10, 2022 in Digital Marketing by Kichu
• 19,050 points
436 views
0 votes
1 answer

CSS - Darken image except for rectangle overlay

Perhaps try constructing four boxes, one on ...READ MORE

answered May 28, 2022 in CSS by Edureka
• 12,690 points
526 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP