How to put a jpg or png image into a button in HTML

后端 未结 8 2178
面向向阳花
面向向阳花 2020-12-09 16:57

I want a button with an image in it. I am using this:

 

But it do

相关标签:
8条回答
  • 2020-12-09 17:13

    This may work for you, try it and see if it works:

    <input type="image" src="/library/graphics/cecb2.gif">
    
    0 讨论(0)
  • 2020-12-09 17:15

    You can style the button using CSS or use an image-input. Additionally you might use the button element which supports inline content.

    <button type="submit"><img src="/path/to/image" alt="Submit"></button>
    
    0 讨论(0)
  • 2020-12-09 17:19
    <a href="#">
            <img src="p.png"></img>
        </a>
    
    0 讨论(0)
  • 2020-12-09 17:25

    Use <button> element instead of <input type=button />

    0 讨论(0)
  • 2020-12-09 17:29

    You can use some inline CSS like this

    <input type="submit" name="submit" style="background: url(images/stack.png); width:100px; height:25px;" />
    

    Should do the magic, also you may wanna do a border:none; to get rid of the standard borders.

    0 讨论(0)
  • 2020-12-09 17:34
    <input type= "image" id=" " onclick=" " src=" " />
    

    it works.

    0 讨论(0)
提交回复
热议问题