
用img做图片按钮的方法。。图片就是你的图片,下载后改名为img.jpg保存在同一级目录就行了。
注意,如果要用图片做按钮,必须要保证,你那个input的border为none,而且那个input必须要有宽和高。
这种方法仅供参考。。。还是建议你直接用<input type="image" src="">这种。。图片上ps上文字,不过,用背景img也不错,至少减少了服务器的压力。。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric//EN""
<html xmlns="
<head>
<title>新建网页</title>
<meta http-equiv="Content-Type" content="text/html charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<style type="text/css">
#bimg {
background:url(img.jpg) -60px -40px
width:125px
height:30px
border:none
font-weight:bold
color:white
}
</style>
</head>
<body>
<form method="GET" action="">
<input type="text" name="mae" value="wca">
<input id="bimg" type="submit" value="提交">
</form>
</body>
</html>
<input type="button" value="文字" />如上,value 就为按钮的文字, 如果要是用php来添加文字的话,那么可以改成:
<input type="button" value="<?php echo '文字'?>" />
在php 里面可以写相应的程序。
在表单中有两种按钮可以使用,分别为:提交按钮、重置。这一小节讲解提交按钮:当用户需要提交表单信息到服务器时,需要用到 提交按钮 。语法 :
type :只有当type值设置为submit时,按钮才有提交作用
value : 按钮上显示的文字
举例 :
在浏览器中显示的结果:
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)