the button I have this css for my html button:
.link-container button {
background-color: #444;
color: white;
border: none;
padding: 10px;
border-radius: 5px;
cursor: pointer;
width: 100%;
background-image: url(imgs/openbutton.png);
}
this is the html code for the button:
<button onclick="window.location.href='https://example.com/link2';"></button>
this is my problem, its too bug:
I have searched online for solutions, havent found anything, and I was kind expecting for it to shrink and fit…
TheAlphaLeopard is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
Try, below CSS code …
.link-container button {
background-color: #444;
color: white;
border: none;
padding: 10px;
border-radius: 5px;
cursor: pointer;
width: 100%;
background-image: url('imgs/openbutton.png');
background-size: contain; /* Makes the image fit within the button */
background-repeat: no-repeat; /* Prevents the image from repeating */
background-position: center; /* Centers the image within the button */
}
Utsav katharotiya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.