Use ASP + CSS to change the color of a list by line

Source: Internet
Author: User

The line-by-line update of a list refers toArticleIn the list, the background color of the first line and the last line is displayed alternately, also known as the zebra line, which adds a lot of colors to the webpage. Today, I saw Xiao Yi's post on Bi, "thinking about changing colors under the standard". The background of the two lines of UL is repeated. Although the method is good, the height of Li can only use the actual height in the background, not flexible enough, so I wrote one with ASP + CSS and used a custom list.

<% Set rs = ...... SQL = "...... "Rs. open SQL, Con, 1,1%> <DL> <% I = 0Do 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 + 1RS. movenextloop %> </dl>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.