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 in HTML by Ashwini
• 1,160 points
7 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 in HTML by Tejashwini
• 1,660 points
14 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 in HTML by Tejashwini
• 1,660 points
12 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 in HTML by Ashwini
• 1,160 points
13 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 in HTML by Ashwini
• 1,160 points
8 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,500 points
794 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
891 views
0 votes
1 answer

Render HTML to an image

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

answered Feb 8 in Java by Soham
• 8,740 points
444 views
0 votes
0 answers

seo - images and h1

I like to have logos instead of ...READ MORE

Mar 9 in Digital Marketing by Kichu
• 19,040 points
70 views
0 votes
0 answers

When to use IMG vs. CSS background-image?

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

Mar 10 in Digital Marketing by Kichu
• 19,040 points
34 views
0 votes
1 answer

CSS - Darken image except for rectangle overlay

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

answered May 28 in CSS by Edureka
• 9,540 points
58 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP