常用替换 JS(trim,ltrim,rtrim)和替换HTML标签
http://hi.baidu.com/sunsonruby/blog/item/e1bd76d5cc0efec751da4bc9.html
http://sxpyrgz.javaeye.com/blog/397470
<html>
<head>
<title>中国站长天空-网页特效-表单特效-只能输入中文的文本框</title>
<meta http-equiv="content-Type" content="text/html;charset=gb2312">
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
只能输入中文的文本框:<input onkeyup="value=value.replace(/[ -~]/g,'')">
</body>
< /html> ......
http://localhost:8080/tj16/
"/"代表根目录,"./" 代表当前目录,"../"代表上级目录。
服务器端的相对地址指的是相对于你的web应用的地址,是在服务器端解析的。(http://localhost:8080/tj16/)
html页面中的相对地址都是相对于服务器根目录,是客户端浏览器解析的。(http://localhost:8080/)
webapp tj16
i:/test/tj16/a.jsp
i:/test/tj16/aa/aa.jsp
i:/test/tj16/aa/bb.jsp
i:/test/tj16/aa/cc/c.jsp
地址栏中输入地址:[http://localhost:8080/tj16/aa/aa.jsp]
aa.jsp中内容
(1)<a href="../a.jsp">test1</a> || 连接到[http://localhost:8080/tj16/a.jsp]
(2)<a href="/tj16/a.jsp">test2</a> || 连接到[http://localhost:8080/tj16/a.jsp]
(3)<a href="/a.jsp">test3</a> || 连接到[http://localhost:8080/a.jsp]
(4)<a href="./bb.jsp">test4</a>  ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>www.zishu.cn</title>
<style>
/*全局处理一下*/
ul{margin:0 0 0 50px;font-size:12px;}
/*tab 基础CSS原形 可扩展*/
.tab li{display:inline;}
.tab a{background: url(http://www.zishu.cn/attachments/month_0708/u2007823223236.gif) no-repeat;}
.tab a:link,.tab a:visited{float:left;background-position:right -226px;text-decoration: none; margin-left:-20px; padding-right:30px;}
.tab a:link span,.tab a:visited span{display:block;background: url(http://www.zishu.cn/attachments/month_0708/u2007823223236.gif) no-repeat left top;padding:5px 15px 2px 15px; color:#000}
.tab a:hover,.tab a:active{background-position:right -264px;}
.tab a:hover span,.tab a:active span{background-position ......
/*不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在后面。*/
.JS_CenterAD_marquee_Right
{
margin-left:17px !important; /firefox*/
*margin-left:17px !important; /ie7*/
_margin-left:17px; /*此 _margin-left 写法仅支持ie6,其他浏览器均不支持*/
*+margin-top:-150px;
} ......
在制作一个浮动图片用于网站显示时,出现图片固定不浮动,最终检查发现 DIV浮动与
http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd冲突
去掉这段可暂时实现浮动。
但此代码不可随意去掉,去掉后又会导致DIV某些属性混乱。幸好此次暂时不使用某些功能
临时解决办法,期待更好的解决办法 ......
这篇文章是在如下地址看到的:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/CSS/Q_23302976.html
首先是HTML部分:
<
body>
<
div id="loading">
<div><img src="../images/loading.gif" /><span>Please Wait</span></div>
</div>
</
body>
然后CSS是部分,做了些修改:
body,
html
{
margin:0
;
height:100%
;
min-height:100%
;
}
#loading
{
background:#ccc
;
position:absolute
;
top: 0
;
left: 0
;
min-height:100%
;
height:auto !important
;
height:100%
;
width:100%
;
filter:alpha(opacity=50)
;
opacity:0.5
;
-moz-opacity: .50
;
这里最总要的是:height:auto !important;
& ......