Making an image act like a button

前端 未结 3 1922
执念已碎
执念已碎 2020-12-25 11:34

I\'m working on a simple HTML page where I have this image that I want to act as a button.

Here is the code for my image:

相关标签:
3条回答
  • 2020-12-25 11:38

    It sounds like you want an image button:

    <input type="image" src="logg.png" name="saveForm" class="btTxt submit" id="saveForm" />
    

    Alternatively, you can use CSS to make the existing submit button use your image as its background.

    In any case, you don't want a separate <img /> element on the page.

    0 讨论(0)
  • 2020-12-25 11:41

    You could use an image submit button:

    <input type="image"  id="saveform" src="logg.png " alt="Submit Form" />
    
    0 讨论(0)
  • 2020-12-25 11:42

    You could implement a JavaScript block which contains a function with your needs.

    <div style="position: absolute; left: 10px; top: 40px;"> 
        <img src="logg.png" width="114" height="38" onclick="DoSomething();" />
    </div>
    
    0 讨论(0)
提交回复
热议问题