ボタン画像が読み込まれる前に何が起こるか、その後ろにボタンがあり、それは非常に奇妙です...どうすればそれを取り除くことができますか?
<button id="cambtn" onclick="camera()"><img id="camicon" src="camera.png" alt="Camera" width="120" style="position:absolute; left:50px; top:50px;"></button>
If you put this snippet in your style sheet it should take care of the button formatting.
#cambtn {
background: transparent;
border: 0 none;
padding: 0;
}
Inline example (although not recommended):
<button style="background: transparent;border: 0 none;padding: 0;" id="cambtn" onclick="camera()"><img id="camicon" src="camera.png" alt="Camera" width="120" style="position:absolute; left:50px; top:50px;"></button>
ボタンが必要ない場合は、button
要素を使用しないでください。要素がフォーム内にないと仮定すると、クリック機能を画像に直接割り当てるだけです。
<img id="camicon" onclick="camera()" src="camera.png" ...>