Using ASP program to simulate and realize first-child function

Source: Internet
Author: User

First-child the style sheet property used to set the first child object (SELECTOR2) of an object (Selector1). For example, the first row of a list of styles can be different from other rows, but the current IE does not support this pseudo class. The following is a method to simulate the implementation with ASP.

Today to see the classic in the discussion of this issue, Realazy's approach is to use the javascript,zbm2001z approach is to use the expression, I think if this list is read from the database, it may be easier to write with the program. I am not a programmer, only a little of the simplest ASP, such as bad writing, but also please a lot of guidance and understanding!

The following is a reference fragment for ASP code:

' Database Connection code

response.write"<ulclass='fgList'>"
rs.movefirst
response.write"<liclass='firstchild'><atitle=''href='#'>"&rs("列表标题")&"</a></li>"
rs.movenext
dowhilenot(rs.eoforerr)
response.write"<li><atitle=''href='#'>"&rs("列表标题")&"</a></li>"
rs.moveNext
loop
response.write"</ul>"
response.write" ul.fgList{
list-style:none;
}
ul.fgLista{
color:#333333;
background:url(/img/arrow_l2.gif)no-repeat050%;
padding-left:1.5em;
line-height:2em;
text-decoration:none;
}
ul.fgLista:hover{
color:#999999;
text-decoration:underline;
background:inherit;
}
ul.fgListli.firstchilda{
color:#C00;
background:url(/img/arrow_l2_over.gif)no-repeat050%;
}
h3{
font-size:120%;
padding:2em1em.3em.3em;
}

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.