asp文章变色

来源:百度知道 编辑:UC知道 时间:2024/06/01 22:58:22
<%
sql="select top 5 article.newsid,selectpic,title,shenghe,dateandtime,article.typeid,article.ntypeid,ntype.ntype from article,ntype where shenghe=1 and article.ntypeid=ntype.ntypeid and article.typeid=17 order by article.dateandtime desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof %>

<tr>
<td height="18" width="6%"><div align="left"><IMG height=17
src="images/ajdian.gif" width=15></div></td>
<td height="18" width="77%"><a href="show.asp?id=<%=rs("newsid")%>" target="_blank"><%=rs("title")%></a></td>
<td width="17%"><a href="show.asp?id=<%=rs("newsid")%>" t

do while not rs.eof
后面加上
i=i+1
if i=1 then
<style type="text/css">
<!--
.STYLE1 {
color: #FF0000;
}
-->
</style>
end if
然后在你需要变色的地方设置class
就可以了