asp 请教怎么给自动序号前三位加颜色?
文章列表前有自动序号,请教怎么只给前三位加序号加红色?<%SetRs2=Server.CreateObject("ADODB.Recordset")sqlcyte1="s...
文章列表前有自动序号,请教怎么只给前三位加序号加红色?
<%
Set Rs2=Server.CreateObject("ADODB.Recordset")
sqlcyte1 = "select top 10 id,sp_mc,hits from news order by hits desc"
rs2.Open sqlcyte1,conn,1,1
n=0
Do While Not Rs2.Eof
n=n+1
hits=rtnreplaceint(rs("hits"),1)
%>
<li><i class="h"><%=n%></i><a href="/news/news.asp?id=<%=Rs2(0)%>" target="_blank"><%=Rs2(1)%></a> <%=Rs2("hits")%></li>
<%
Rs2.MoveNext
Loop
Rs2.Close
%> 展开
<%
Set Rs2=Server.CreateObject("ADODB.Recordset")
sqlcyte1 = "select top 10 id,sp_mc,hits from news order by hits desc"
rs2.Open sqlcyte1,conn,1,1
n=0
Do While Not Rs2.Eof
n=n+1
hits=rtnreplaceint(rs("hits"),1)
%>
<li><i class="h"><%=n%></i><a href="/news/news.asp?id=<%=Rs2(0)%>" target="_blank"><%=Rs2(1)%></a> <%=Rs2("hits")%></li>
<%
Rs2.MoveNext
Loop
Rs2.Close
%> 展开
1个回答
展开全部
Do While Not Rs2.Eof
n=n+1
hits=rtnreplaceint(rs("hits"),1)
if n<=3 then
%>
<li><i class="h" style="color:#FF0000"><%=n%></i><% else %>
<li><i class="h"><%=n%></i><% end if %>
<a href="/news/news.asp?id=<%=Rs2(0)%>" target="_blank"><%=Rs2(1)%></a> <%=Rs2("hits")%></li>
n=n+1
hits=rtnreplaceint(rs("hits"),1)
if n<=3 then
%>
<li><i class="h" style="color:#FF0000"><%=n%></i><% else %>
<li><i class="h"><%=n%></i><% end if %>
<a href="/news/news.asp?id=<%=Rs2(0)%>" target="_blank"><%=Rs2(1)%></a> <%=Rs2("hits")%></li>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询