ASP+CSS implements interlaced color change in list_CSS/HTML

WBOY
Release: 2016-05-16 12:12:36
Original
2321 people have browsed it

List interlaced color changing means that in news and article lists, the background colors of the previous line and the next line are displayed alternately. It can also be called zebra crossing, which can add a lot of color to the web page. Today I saw Xiaoyi's post on BI "Thinking about changing colors in alternate rows under standards" , using the two rows of UL to repeat the background. Although the method is good, the height in LI can only use the actual height in the background. It's not flexible enough, so I wrote one using ASP+CSS and used a custom list.

<%
set rs=......
sql="......"
rs.open sql,con,1,1
%>
<dl>
<% 
i=0
do while not (rs.eof or err)%>
<dt><a href="http://www.forest53.com/tutorials_show.asp?
sortid=<%=rs("sortid")%>&id=<%=rs("id")%>"><%=rs("biaoti")%>
</a></dt>
<% if i mod 2 = 0 then%>
<dd>
<% else %>
<dd class="two"> 
<% end if %>
<%=rs("zhaiyao")%>
</dd>
<%
i=i+1
rs.moveNext
loop
%>
</dl>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!