惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - 中国被爱可以在线

[珍藏]什么是威客,2008最新验证威客网址 QuickWAP各版本安装注册方式对比 QuickWAP2.x增加跳转函数Redirect - 中国被爱可以在线 - 博客园 关于实现QuickWAP 2.x绿色安装版的实现 QuickWAP 2.x使用IP注册实例 - 中国被爱可以在线 - 博客园 第一次使用QuickWAP 2.x QuickWAP V1.5管理员注册器开放 QuickWAP 2.x注册方法和购买注意事项 QuickWAP 2.x之英文、简繁体文章内容分页 QuickWAP2.0/2005WAP登录设计一例 WML编辑工具-BicyleWapTool V2.5 QuickWAP 2005 简易使用手册 WAP网站域名解析 QuickWAP 2005让WAP网站拥有更好的兼容性 QuickWAP 2005安装指南 QuickWAP 2005留言本一例 庆祝中国被爱可以在线下载站开通 QuickWAP 2005 简单概览 WAP中UBB标签的应用
给QuickWAP2.x应用CSS样式
中国被爱可以在线 · 2008-01-27 · via 博客园 - 中国被爱可以在线

  QuickWAP自2005后,包括2005、2.0、2.x版本中都有了智能型框架函数AutoHeader和AutoFooter,他们能够根据浏览器自动产生不同的语言的代码,比如在IE中使用HTML代码,在WAP浏览器中使用WML代码。

  名称 AutoHeader
  函数声明 Public Sub AutoHeader(Optional ByVal HtmlCssFileName As String)
  作用 用于根据终端浏览器类型输出WAP文件的头部的函数。
  例句 Wap.AutoHeader "css.css"

  名称 AutoFooter
  函数声明 Public Sub AutoFooter()
  作用 用于根据终端浏览器类型输出WAP文件的末尾的函数。
  例句 Wap.AutoFooter

  下面我们就可以通过一个例子来看看效果,当然在浏览器中我们自己可查看IE和WAP浏览器中产生的源代码是不同的,我们主要比较一下在IE中CSS对QuickWAP显示结果的影响,在WAP中影响是不明显的。

<%
Set Wap=Server.CreateObject("QuickWAP.WAP")
Wap.CardTitle="中国被爱可以在线"
Wap.AutoHeader
'以下为文件正文。
Wap.WriteRow "++++++++++++++++++"
Wap.WriteRow Wap.Anchor("确定","#SecondCard","第二卡片")
Wap.WriteRow Wap.Anchor("新闻","NewsList.asp","公司新闻")
Wap.WriteRow Wap.Anchor("确定","FriendLink.asp","友情链接")
Wap.WriteRow Wap.Anchor("留言","GuestBook.asp","留言反馈")
Wap.WriteRow Wap.Anchor("进入","About.asp","关于本站")
Wap.WriteRow "++++++++++++++++++"
'以下为返回链接等信息。
Wap.WriteRow Wap.BackA("返回上页")
Wap.WriteRow Wap.ImgA("",Wap.WapPath,"返回首页")
Wap.WriteRow Wap.DoGo(Wap.WapPath, "option", "回首页")
Wap.WriteRow Wap.DoPrev("prev", "后退", "ToBack")
Wap.AutoFooter
Set Wap=Nothing
%>

  我们在IE中浏览该文件,如下图:

  我们可以看到代码Wap.AutoHeader并没有加CSS样式,但是在QuickWAP内部却集成了CSS样式,样式文件如下代码:

BODY
{
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-size: 9pt;
}
TD {
FONT-SIZE: 11px;
color: #000000;
font-family: "Arial", "Helvetica", "sans-serif"
}
P {
FONT-SIZE: 11px;
color: #000000;
font-family: "Arial", "Helvetica", "sans-serif"}
LI
{
FONT-SIZE: 11px;
text-decoration: none;
color: #000000;
font-family: "Arial", "Helvetica", "sans-serif"
}
INPUT
{
FONT-SIZE: 11px;
color: #000000;
font-family: "Arial", "Helvetica", "sans-serif"
}
A:link
{
COLOR: #0000FF;
TEXT-DECORATION: underline
}
A:visited
{
Text-DECORATION: none;
color: #9900CC
}
A:active
{
COLOR: #FF00FF;
TEXT-DECORATION: none
}
A:hover {
COLOR: #FF0000;
TEXT-DECORATION: none}
.button
{
background: #ffffff;
border: #333333 1px solid;
cursor: hand;
font-size: 9pt;
height: 20px;
padding: 1px;
COLOR: #009900;
BORDER-TOP-STYLE: none;
BORDER-RIGHT-STYLE: none;
BORDER-LEFT-STYLE: none;
BORDER-BOTTOM-STYLE: none
}

我们把上边的CSS代码保存为style.css,并修改相关参数。比如Body中字体改为12pt。

BODY
{
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-size: 12pt;
}
A:link
{
COLOR: #FF00FF;
TEXT-DECORATION: underline
}

同时修改我们的主文件,如下边红色文字,同时加上了样式的文件地址,这时内部CSS失效,将启用设置的CSS样式表,记得一定要采用相对路径:

<%
Set Wap=Server.CreateObject("QuickWAP.WAP")
Wap.CardTitle="中国被爱可以在线"
Wap.AutoHeader "Style.css"
'以下为文件正文。
Wap.WriteRow "++++++++++++++++++"
Wap.WriteRow Wap.Anchor("确定","#SecondCard","第二卡片")
Wap.WriteRow Wap.Anchor("新闻","NewsList.asp","公司新闻")
Wap.WriteRow Wap.Anchor("确定","FriendLink.asp","友情链接")
Wap.WriteRow Wap.Anchor("留言","GuestBook.asp","留言反馈")
Wap.WriteRow Wap.Anchor("进入","About.asp","关于本站")
Wap.WriteRow "++++++++++++++++++"
'以下为返回链接等信息。
Wap.WriteRow Wap.BackA("返回上页")
Wap.WriteRow Wap.ImgA("",Wap.WapPath,"返回首页")
Wap.WriteRow Wap.DoGo(Wap.WapPath, "option", "回首页")
Wap.WriteRow Wap.DoPrev("prev", "后退", "ToBack")
Wap.AutoFooter
Set Wap=Nothing
%>

下面我们看一下修改后的在IE浏览器中的效果:

但是无论是否加样式文件在WAP中都不会产生影响,这就是QuickWAP的智能性。很多有趣的东西还等你去发现... ...