javascript - How can I make png image act as a button? -
i using dreamweaver first time code. intermediate in html.
i've been trying use png file button. i've found sources stating ...
<button src=home_button> </button>
... work, have tried it, , no avail, not work. suggestions?
note:
i using css build very basic website.
just add background-image
button.
<button id="home_button">click me</button>
and add:
#home_button { background-image: url(...); }
you may need add further styling of course, such widths , other background properties right. how add background image button.
here's working demo well:
#home_button { width: 150px; height: 150px; background-image: url('http://i.stack.imgur.com/sfed8.png'); background-size: cover; background-color: #eee; }
<button id="home_button"></button>
Comments
Post a Comment