首先把图片放在img文件夹下的 ,img是放在MyEclipse的WebRoot里面的,否则路径可能不对。
(1):
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body background="img/1.jpg"> </body> </html>
(2):
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.b{background-image:url(img/1.jpg)}
</style>
</head>
<body Class="b">
</body>
</html> 还可以把css单独写,不管什么页面用的时候都可以用link调用那个css的名字就可以了。
以上就是jsp怎么将图片设置为背景的详细内容,更多请关注Gxl网其它相关文章!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did70295