12 2012 档案

摘要:详细解说,直接看样式:#dingwei{padding:10px;background-color:#003300;color:#FFFFFF;width:600px;height:300px;display:block;position: absolute;top:50%;left:50%;margin-left:-300px;margin-top:-150px;}padding:10px;background-color:#003300;color:#FFFFFF; 这几句都是装饰性的东西不是核心;width:600px;height:300px; DIV总的有个宽高吧,根据你的具体情况设 阅读全文
posted @ 2012-12-24 10:07 残剑_ 阅读(2113) 评论(0) 推荐(0) 编辑
摘要:正常情况下需要将div居中显示时,使用Css样式:margin:0 auto即可,但有时使用margin:0 auto后在FF、Chrome里能居中,而在IE678里不居中的现象。如下代码:<style type="text/css">#con{width:980px;martin:0 auto;}</style><div id="con">margin: 0 auto 内容居中显示</div>解决方法一可以是对网页主体<body>声明文本居中,即body{text-align:center}即 阅读全文
posted @ 2012-12-24 10:05 残剑_ 阅读(375) 评论(0) 推荐(0) 编辑
摘要:首先写一个过滤器的类,如下: 1 package com.util; 2 3 import java.io.IOException; 4 import java.io.UnsupportedEncodingException; 5 6 import javax.servlet.Filter; 7 import javax.servlet.FilterChain; 8 import javax.servlet.FilterConfig; 9 import javax.servlet.ServletException;10 import javax.servlet.ServletRequest.. 阅读全文
posted @ 2012-12-17 13:23 残剑_ 阅读(9232) 评论(0) 推荐(2) 编辑
摘要:写cookie Cookie cookie = new Cookie("username", java.net.URLEncoder.encode(username,"UTF-8")); cookie.setMaxAge(50*60);//不设置的话,则cookies不写入硬盘,而是写在内存,只在当前页面有用,以秒为单位 response.addCookie(cookie);读cookieCookie cookies[] = request.getCookies(); if (cookies != null) { for (int i = 0; i &l 阅读全文
posted @ 2012-12-17 13:09 残剑_ 阅读(409) 评论(0) 推荐(0) 编辑