Dan
asked on
How to overlay text on a button with a background image
I have a button and I want to have a background image but then put text vertically centered in the button how can I place the text over the image. The code I have is:
<button class="dropbtn" style="width: 100% height: 20px; background-color: #D0D5E8; margin: 0px; padding: 0px;"><img src="button-bg.png"></butt on>
This way the background gives it the style but the text will always be sharp as it is not being scaled.
Thanks,
<button class="dropbtn" style="width: 100% height: 20px; background-color: #D0D5E8; margin: 0px; padding: 0px;"><img src="button-bg.png"></butt
This way the background gives it the style but the text will always be sharp as it is not being scaled.
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, you didn't have ";" after the width which stopped all the other styles processing.
Here is the correct markup.
Open in new window