Agama是一款非常好用的html圖片按鈕制作工具,有制作圖片樣本
在一般情況下按鈕提交表單:
<form id="form1" name="form1" method="post" action="index.html"><input type="submit" name="button" id="button" value="提交" />
</form>
這樣提交按鈕是標(biāo)簽 <input type="submit">,如果想換成圖片加上樣式,把value="提交" 改成value=" "(這樣“提交”兩個(gè)字就不會(huì)顯示在這張背景圖片的上面):
#button{
background:url(12.jpg) no-repeat;
width:100px;
height:50px;
border:0px;
cursor:pointer;
}
直接使用圖片標(biāo)簽按鈕
<form id="form1" name="form1" method="post" action="index.html"><input name="submit" type="image" value="ee" src="12.jpg" />
</form>
這樣子直接寫在html頁面上就能直接看到按鈕是圖片的!
由于上面第二種圖片直接使用 “src”鏈接,但是如果一個(gè)網(wǎng)站很多需要到表單圖片按鈕展示的話,這樣就會(huì)增加網(wǎng)頁顯示的速度!之前說過如果把全部類型差不多的圖片整合成一張,每個(gè)頁面使用css+div調(diào)用同一張圖片里面的不同個(gè)按鈕圖標(biāo)圖片,這樣的話便能更優(yōu)化代碼以及網(wǎng)站。
<form id="form1" name="form1" method="post" action="index.html">
<input name="submit" type="image" value="ee" src="12.jpg" />
</form>
樣式:
button{
background:url(12.jpg) no-repeat -54px -35px;
width:100px;
height:50px;
border:0px;
cursor:pointer;
}