改了WAP文本表单的格式,终于可以发中文了,咱得琢磨着怎么修改手机上的软件让WAP浏览器的文本表单只能添50个字的限制给改了……
改了WAP文本表单的格式,终于可以发中文了,咱得琢磨着怎么修改手机上的软件让WAP浏览器的文本表单只能添50个字的限制给改了……
控制表格居中最常见的方式就是设置其align属性为center,而在css中是找不到align的,于是控制table父级元素的text-align属性就成了一种普遍的替代方案。
例如,可以给该table外套上一个宽度为100%的表格,该表格只包含一个td,然后设置这个td的text-align属性为center就可以了。
还可以给该table外套一个div,控制该div的text-align属性。
或者在table外加上<center>标签。
如果只是想让所有网页内容居中的话,可以在css中设置body{text-align:center;}。
但这都是替代方案,并非从根本上控制了table的对齐方式,其实利用css中的expression完全可以实现。
在css中定义一个伪类:
.myTableCenter{myalign:expression(this.align="right");}
然后在该table中引用就可以了:
<table class="myTableCenter" ......</table>
下面是完整的html演示代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>css控制表格居中演示</title>
<style type="text/css">
<!--
.table_center {
background-color: #0000ff;
border:1px solid #222222;
myalign:expression(this.align="center");
}
.table_left {
background-color: #ff0000;
border:1px solid #222222;
}
-->
</style></head>
<body>
<table width="500" border="0" cellpadding="0" cellspacing="0" class="table_center">
<tr>
<td>center</td>
</tr>
</table>
<br>
<table width="500" border="0" cellpadding="0" cellspacing="0" class="table_left">
<tr>
<td>left</td>
</tr>
</table>
</body>
(ASP)
host=lcase(request.servervariables("HTTP_HOST"))
'开始条件跳转
SELECT CASE host
CASE "blog.it19.cn"
response.redirect "/blog/"
CASE "bbs.it19.cn"
response.redirect "/bbs/"
case "cyle.it19.cn"
response.redirect "/cyle/"
case "www.it19.cn"
response.redirect "/cyle/"
CASE ELSE
response.redirect "/main/"
END SELECT
%>
(PHP)情况:多个域名都指向一台服务器的同一个文件夹"NNN",要求
www.ddd.com
www.eee.com
当URL为www.ddd.com的时候,页面自动跳转到NNN文件夹里的ddd
当URL为www.eee.com的时候,页面自动跳转到NNN文件夹里的index.htm
代码:
<?php
$domain_net="guan8.net";
$domain_com="362700.com";
$dot_net_url="bbs/";
$dot_com_url="index.html";
if(($HTTP_HOST=="$domain_net")or($HTTP_HOST=="www.$domain_net"))
{
Header("Location: $dot_net_url");
}
elseif(($HTTP_HOST=="$domain_com")or($HTTP_HOST=="www.$domain_com"))
{
Header("Location: $dot_com_url");
}
else
{
include_once('hehe.php');
}
?>
(JS)代码:
<script>try {if( self.location == "http://玉米一/" ) {
top.location.href = "http://玉米一/目录";
}
else if( self.location == "http://玉米二/" ) {
top.location.href = "http://玉米二/目录";
}
else if( self.location == "http://玉米三/" ) {
top.location.href = "http://玉米三/目录";
}
else if( self.location == "http://玉米四/" ) {
top.location.href = "http://玉米四/目录";
}
else {document.write ("错误的访问地址")}} catch(e) {}</script>
相信各位都能看懂,不用多说。
有一个缺陷就是在搜索框输入内容后,必须使用鼠标点击提交按键才能生效,按回车是没有用的。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>站内搜索</TITLE> <META http-equiv=Content-Type content="text/html; CHARSET=gb2312"> <META content="MSHTML 6.00.2800.1106" name=GENERATOR> <SCRIPT language=javascript> var key = ""; function makeEntry (){ this.Name=""; this.URL = ""; this.Desc = ""; this.Category = ""; this.Target = ""; return this; } function makeArray(n) { this.length = n; for (var k = 1; k <= n; k++) { this[k] = ""; } return this; } function makeLinks(size) { this.length = size; for (var r=1; r<= size; r++) { this[r] = new makeEntry(); this[r].Name = namesArray[r]; this[r].URL = urlsArray[r]; this[r].Desc = descArray[r]; this[r].Category = categoryArray[r]; this[r].Target = targetArray[r]; } return this; } var linksize=0 datesArray = new makeArray(linksize); namesArray = new makeArray(linksize); urlsArray = new makeArray(linksize); descArray = new makeArray(linksize); categoryArray = new makeArray(linksize); targetArray = new makeArray(linksize); var arraycount=0 <!-- 数据库部分由此开始 --> arraycount += 1 urlsArray[arraycount] = "http://java2000.126.com" namesArray[arraycount] = "java脚本资源站Chinese-GB" descArray[arraycount] = "java, javascript, scripts, applet, html, dhtml ,activex, midi, search, downloads, 脚本, free, 免费资源" categoryArray[arraycount] = "最酷的java脚本资源站,大量详细的java源代码和实例说明!" targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://members.aol.com/MASTER54X/Anime.html" namesArray[arraycount] = "Anime Master" descArray[arraycount] = "anime master, anime, project a-ko, vampire hunter D, tenchi muyo, bubblegum crisis, sailor moon, sailormoon, gunsmith cats, slayers, all purpose cultural cat girl nuku nuku, plastic little, devil hunter yohko, iria: zeiram the animation, iria, ranma 1/2, ranma, fist of the north star, multimedia, galleries, pic galleries, picture gallery, image gallery, image galleries" categoryArray[arraycount] = "Multimedia, Image galleries for project a-ko, vampire hunter D, tenchi muyo, bubblegum crisis, sailormoon, gunsmith cats, slayers, all purpose cultural cat girl nuku nuku, plastic little, devil hunter yohko, iria: zeiram the animation, ranma 1/2, and fist of the north star." targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://www.geocities.com/Tokyo/Towers/6508/" namesArray[arraycount] = "The Anime Shrine" descArray[arraycount] = "the anime shrine, anime shrine, anime, the anime shrine, anime shrine, manga, saintseiya, fushigiyuugi, fushigi yuugi, evangelion, neon genesis evangelion, eva, ranma, ranma 1/2" categoryArray[arraycount] = "this is a fairly large site with large image galleries from many dif animes, many links, gives out awards, has 3 voting shrines, also sub-Shrines for Fushigi Yuugi, SaintSeiya, Evangelion, and Ranma 1/2. And much more! Must see!" targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://home.taegu.net/~virus/" namesArray[arraycount] = "Evangelion Site" descArray[arraycount] = "evangelion site, anime, evangelion, neon genesis, neon genesis evangelion, eva, neon, genesis" categoryArray[arraycount] = "This site is about evangelion, but available in Korean only..." targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://animeonline.org/" namesArray[arraycount] = "The Animeonline Network" descArray[arraycount] = "the animeonline network, anime, animecca, news, information, anime magazine, magazine, zine, e-zine" categoryArray[arraycount] = "Your Online Anime Magazine!" targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://www.visi.com/~vdgaijin/gaijin.html" namesArray[arraycount] = "Psychommu Gaijin Anime E-zine" descArray[arraycount] = "psychommu gaijin anime e-zine, anime, music, links, news, information, e-zine, zine" categoryArray[arraycount] = "Our aim is to provide you with news and information on some of the coolest aspects of Anime. Old and new! So come on in and enjoy!" targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://the.animearchive.org/" namesArray[arraycount] = "Ultimate Animanga Archive" descArray[arraycount] = "ultimate animanga archive, anime, manga, images, pictures, image gallery, midi, image galleries, music, chat, information, descriptions, info" categoryArray[arraycount] = "Searchable page of images, info, and descriptions of anime OAVs and series." targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://otakuworld.com/" namesArray[arraycount] = "Otaku World" descArray[arraycount] = "otaku world, anime, manga, desktop themes, anime themes, search engine, link database, web rings, web ring" categoryArray[arraycount] = "One of the largest multimedia anime sources on the web!" targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://www.usagi.com" namesArray[arraycount] = "Usagi.com" descArray[arraycount] = "usagi.com, anime, manga, links, link, database, tenchi, tenchi muyo, download, multimedia" categoryArray[arraycount] = "Your guide to the online anime community!" targetArray[arraycount] = "target=_blank" arraycount += 1 urlsArray[arraycount] = "http://www.si.hhs.nl/~v962343/home.html" namesArray[arraycount] = "Richie's Place" descArray[arraycount] = "richie's place, anime, manga, pictures, pics, movies, links, gif animations, animation, hentai, java, link" categoryArray[arraycount] = "Richie's Place! Over 30 pages! with a picture gallery, movies, gif animations, games, java and more." targetArray[arraycount] = "target=_blank" linksize = arraycount; // ----数据库结束 ------ // ----以下是输出结果检索结果的页面代码 ---- function searchLinks(links, keyword){ document.write("<HTML><TITLE>" +keyword +" - 站内搜索</TITLE><META http-equiv=Content-Type content='text/html; CHARSET=gb2312'><BODY fontsize='3' LINK='#0000ff' VLINK='#840084'>") document.write("搜索关键字 <strong>" +keyword +"</strong> 的结果:<br><br>"); for (var q=1; q<=links.length; q++) { if (links[q].URL.toLowerCase().indexOf(keyword) != -1){ document.write("<a href=" + links[q].URL +" " + links[q].Target + ">" + links[q].Name + "</a> <br> "); document.write( links[q].Category + "<br><br>"); continue; } if (links[q].Desc.toLowerCase().indexOf(keyword) != -1) { document.write("<a href=" + links[q].URL +" " + links[q].Target + ">" + links[q].Name + "</a> <br> "); document.write( links[q].Category + "<br><br>"); continue; } if (links[q].Name.toLowerCase().indexOf(keyword) != -1) { document.write("<a href=" + links[q].URL +" " + links[q].Target + ">" + links[q].Name + "</a> <br> "); document.write( links[q].Category + "<br><br>"); continue; } } } </SCRIPT> </HEAD> <BODY><FONT color=#ff0000 size=5>站内搜索引擎<BR></FONT><FONT color=#ff0000><FONT color=#000000>测试:输入关键字"java" 或中文字符"免费" 查询。</FONT></FONT> <DIV></DIV> <P align=center> <FORM name=form> <DIV align=center> <P>查询关键字: <INPUT name=search> <INPUT class=pt9 onclick=validate_form() type=button value=开始查询 name=submit> <INPUT class=pt9 type=reset value=清除 name=reset> <BR></P></DIV></FORM><!-- 以下是合法性检测 --> <SCRIPT> function validate_form() { txt = document.form.search.value; if (txt.indexOf(".") != -1){ alert("Search is invalid! Contains a '.'"); return;} if (txt.indexOf(",") != -1){ alert("Search is invalid! Contains a ','"); return;} if (txt.indexOf("@") != -1){ alert("Search is invalid! Contains a '@''"); return;} if (txt.indexOf("!") != -1){ alert("Search is invalid! Contains a '!''"); return;} if (txt.indexOf("#") != -1){ alert("Search is invalid! Contains a '#''"); return;} if (txt.indexOf("$") != -1){ alert("Search is invalid! Contains a '$''"); return;} if (txt.indexOf("%") != -1){ alert("Search is invalid! Contains a '%''"); return;} if (txt.indexOf("^") != -1){ alert("Search is invalid! Contains a '^''"); return;} if (txt.indexOf("&") != -1){ alert("Search is invalid! Contains a '&''"); return;} if (txt.indexOf("*") != -1){ alert("Search is invalid! Contains a '*''"); return;} if (txt.indexOf("(") != -1){ alert("Search is invalid! Contains a '(''"); return;} if (txt.indexOf(")") != -1){ alert("Search is invalid! Contains a ')''"); return;} if (txt.indexOf("[") != -1){ alert("Search is invalid! Contains a '[''"); return;} if (txt.indexOf("]") != -1){ alert("Search is invalid! Contains a ']''"); return;} if (txt.indexOf(";") != -1){ alert("Search is invalid! Contains a ';''"); return;} if (txt.indexOf(":") != -1){ alert("Search is invalid! Contains a ':''"); return;} if (txt.indexOf("<") != -1){ alert("Search is invalid! Contains a '<''"); return;} if (txt.indexOf(">") != -1){ alert("Search is invalid! Contains a '>''"); return;} if (txt.indexOf("?") != -1){ alert("Search is invalid! Contains a '?''"); return;} if (txt.indexOf("-") != -1){ alert("Search is invalid! Contains a '-''"); return;} if (txt.indexOf("=") != -1){ alert("Search is invalid! Contains a '=''"); return;} if (txt.indexOf("+") != -1){ alert("Search is invalid! Contains a '+''"); return;} else { jsi = new makeLinks(linksize); searchLinks(jsi, txt); document.write("<HR align=center width='99%' color=#000000 noShade SIZE=1>"); document.write("<a href='search.htm'>返回检索页</a><br><br> "); } } </SCRIPT> </BODY></HTML>