用ASP程序模拟实现First-child的功能
作者:佚名 文章来源:网络转载 更新时间
:2007-11-26 0:58:33
first-child用来设置对象(Selector1)的第一个子对象(Selector2)的样式表属性。比如一个列表第一行的样式可以和其他行有所不同,但目前IE尚不支持此伪类。下面给出用ASP模拟实现的方法.
今看到经典里在讨论这个问题 ,Realazy的做法是采用了javascript,zbm2001z的做法是用了expression,我想如果这个列表是从数据库读出 来的话,用程序写可能更容易。我不是什么程序员,只会一点最简单的asp,如写的不好, 还请多多指导谅解!
asp代码
以下是引用片段:
'数据库连接代码
response.write "<ul class='fgList'>"
rs.movefirst
response.write "<li class='firstchild'><a title='' href='#'>"&rs("列表标题")&"</a></li>"
rs.movenext
do while not (rs.eof or err)
response.write "<li><a title='' href='#'>"&rs("列表标题")&"</a></li>"
rs.moveNext
loop
response.write "</ul>"
response.write "<hr />"
CSS Code
以下是引用片段:
ul.fgList{
list-style: none;
}
ul.fgList a{
color: #333333;
background: url(/img/arrow_l2.gif) no-repeat 0 50%;
padding-left: 1.5em;
line-height: 2em;
text-decoration: none;
}
ul.fgList a:hover{
color: #999999;
text-decoration: underline;
background: inherit;
}
ul.fgList li.firstchild a{
color: #C00;
background: url(/img/arrow_l2_over.gif) no-repeat 0 50%;
}
h3{
font-size: 120%;
padding: 2em 1em .3em .3em;
}
【相关文章:】
利用ASP+JMAIL进行邮件群发的新思路
用ASP实现悄悄话的功能
用ASP与ADO查询Web数据库
使用ASP编程常见问题解答
[转帖]ASP程序中上10页、下10页的写法
用ASP连结数据库的语法
对你的ASP程序作负载测试
利用ASP实现三个强大功能
用ASP编写网上调查投票系统
用ASP建立自己网站的每日更新
【发表评论】【打印此文】【关闭窗口】【点击数: 】
★好玩的休闲小游戏★
网友评论:
数据载入中,请稍后……
