Html背景图片问题

来源:百度知道 编辑:UC知道 时间:2024/06/26 01:45:16
<html>
<head>

</head>
<body>
<form method="post" action="login.jsp">
<table background="wofd/login.gif">
<tr><td>账号:<input type="text" name="name" ></td></tr>
<tr><td>密码:<input type="password" name="pwd"></td></tr>
<tr><td><input type="submit" name="登陆" value="登陆">
<input type="button" value="注册" onclick="location.href='regist.html';"></td>
</table>
</form>

</body>
</html>
这是我写的一个网页用户登陆框,图片login.gif存放在E:\jspwork\frist\WebRoot\wofd\login.gif
网页存放在E:\jspwork\frist\WebRoot\wangzhan.html
为什么在myeclipse里预览都有背景效果,实际在tomcat里运行却没有背景?请知道的解答下,谢谢

标签“table”在当前活动版本中不具有属性“background”。[XHTML 1.0 Transitional]

你要么在table外面建立一个div

<div style="background:url(wofd/login.gif)">
<table></table>
</div>

将background="wofd/login.gif" 修改为background="E:\jspwork\frist\WebRoot\wofd\login.gif