让图片布满整个页面
error.jsp
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <% 3 String path = request.getContextPath(); 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 %> 6 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 8 <html> 9 <head> 10 <base href="<%=basePath%>"> 11 <title>主页</title> 12 <meta http-equiv="pragma" content="no-cache"> 13 <meta http-equiv="cache-control" content="no-cache"> 14 <meta http-equiv="expires" content="0"> 15 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> 16 <meta http-equiv="description" content="This is my page"> 17 </head> 18 19 <body background="${pageContext.request.contextPath }/images/error.jpg" 20 style="background-repeat: no-repeat;size: 100% 100%;background-attachment: fixed;"> 21 ${requestScope.ex } 22 <hr> 23 </body> 24 </html>
测试: 整个页面长宽布满100%, 不出现长宽方向的滚动条


浙公网安备 33010602011771号