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

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -