<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{margin: 0pxpadding: 0pxlist-style: nonetext-decoration: none}/*通配符,个人习惯*/
#btn{background: url(https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png)width: 540pxheight: 258px}
</style>
</head>
<body>
<h1>button按钮的背景是图片</h1>
<button id="btn"></button>
</body>
</html>
在html文件中添加一个事件,就是当鼠标滑动到submit按钮上时,设置鼠标样式即可,具体例子如下:
<html>
<body>
<p>请把鼠标移动到单词上,可以看到鼠标指针发生变化:</p>
<span style="cursor:auto">
Default</span><br />
<span style="cursor:pointer">
Pointer</span><br /> <!--这个就是你需要的-->
<span style="cursor:move">
Move</span><br />
<span style="cursor:e-resize">
e-resize</span><br />
<span style="cursor:ne-resize">
ne-resize</span><br />
<span style="cursor:nw-resize">
nw-resize</span><br />
<span style="cursor:text">
text</span><br />
<span style="cursor:wait">
wait</span><br />
<span style="cursor:help">
help</span>
</body>
</html>
这个不怎么难啊,看下面代码<html>
<head>
<title>File</title>
<style type="text/css">
#infile {visibility: hidden}
input {font-family: Verdanafont-size: 9pt}
</style>
<script language="JavaScript">
function changeName()
{
var f = document.getElementById("filename")
f.value = document.getElementById("infile").value
}
function openFile()
{
document.getElementById("infile").click()
}
</script>
</head>
<body>
<input type="file" id="infile" onChange="changeName()" />
<input type="text" id="filename" size="50" maxlength="50" />
<a href="javascript: openFile()"><img src="***.jpg" border="0" /></a>
</body>
</html>
原理:
点击图片链接时,触发打开文件框,如果file框里的内容改变时,把file框里的内容传到文本框。