当前位置:编程学习 > JAVA >>

大神们,servlet输出的页面怎样添加背景图片啊?

servlet输出的页面怎样添加背景图片啊?加背景色可以,加图片不行 是不是不能加啊?
out.println("  <HEAD><TITLE>登陆</TITLE></HEAD>");
out.println("  <BODY bgcolor='FCF4ED'>");
out.println("<h2 align='center' style='margin-top:30px'>欢迎登陆用户信息管理系统</h2>");
out.print("<div align='center' style='margin-top:140px'>");
out.print("<form action='check'>");
这样可以


  
out.println("  <HEAD><TITLE>登陆</TITLE></HEAD>");
out.println("  <BODY background-image:url(img/bg.jpg)>");
out.println("<h2 align='center' style='margin-top:30px'>欢迎登陆用户信息管理系统</h2>");
out.print("<div align='center' style='margin-top:140px'>");
out.print("<form action='check'>");

这样就不行 为什么啊?有没有知道怎么加的  jsp的话我会 但是servlet呢 servlet --------------------编程问答-------------------- 写欠了style --------------------编程问答-------------------- 试试<BODY  style="background-image: url('img/bg.jpg'); width: 100px; height:100px; border: 0px;"   --------------------编程问答-------------------- 楼上正解。直接写在标签中的样式,有时候会忘了style。 --------------------编程问答--------------------
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,