Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add the class for the link 1

Status
Not open for further replies.

bigracefan

Programmer
Apr 2, 2002
304
0
0
US
I'm getting started at css and I'm at point where I need some help. I've got a page that I'm trying to change the link color. Here's what I've got to work with (this is within a table):
Code:
 <%For i = 1 to cPLMaster.recordcount  				       
		
									cPLMaster.MoveTo(i)							  						
		
									If Left(cPLMaster.column("PolicyID"),1)="Q" then
										href="frmrating2.asp?PolicyId="
									Else
									    href="../../unitedemployees/frmHistory.aspx?PolicyId="
									End If
		
									
									If i MOD 2 = 0 Then clr="class=""rptresults2""" Else clr="class=""rptresults1"""%>
		
									<tr>
										<%If cAGMaster.column("AgencyStatus")="A" Or left(cPLMaster.column("PolicyID"),1)<>"Q" Then%>
											<td <%=clr%> height="15"><a href="<%=href%><%=trim(cPLMaster.Column("PolicyId"))%>&amp;InceptionDate=<%=cPLMaster.Column("InceptionDate")%>"><%=cPLMaster.Column("PolicyID")%></a></td>
										<%Else%>
											<td <%=clr%> height="15"><%=cPLMaster.Column("PolicyID")%></td>
										<%End If%>
										<td <%=clr%> height="15"><%=cPLMaster.Column("PreviousPolicyID")%></td>
										<td <%=clr%> height="15" align="center"><%=cPLMaster.Column("InceptionDate")%></td>
										<td <%=clr%> height="15"><%=cPLMaster.Column("PlanID")%></td>
										<td <%=clr%> height="15"><%=cPLMaster.Column("InsName")%></td>
										<td <%=clr%> height="15"><%=cPLMaster.Column("InsAddress")%></td>
										<%If (Request.Cookies("SecurityLevel")) >= 2 AND left(cPLMaster.column("PolicyID"),1)<>"Q" Then%>
											<td <%=clr%> height="15"><a href="frmCatNoticeDetail.asp?PolicyId=<%=trim(cPLMaster.Column("PolicyId"))%>&amp;InceptionDate=<%=cPLMaster.Column("InceptionDate")%>">Add</a></td>
										<%Else%>
											<td <%=clr%> height="15">&nbsp;</td>
										<%End If%>
									</tr>
								<%Next%>

Here is my code from my css:
Code:
.rptresults1 {
	color:#000066;
	background-color:#f5f7f7;
	
}
.rptresults2 {
	color:#f5f7f7;
	background-color:#000066;
This the output of a report and I'm alternating colors on each row. The links are the only thing that doesn't follow my styles. They're always grey. I can't figure out where to insert the class on the href.

Thanks.

 
You would probobly get better help showing rendered html instead of whatever that server side language that is.

Aside from that try your css as follows:
Code:
A.rptresults1:link { color:#000066; background-color:#f5f7f7; }
A.rptresults2:link { color:#f5f7f7; background-color:#000066; }

Now you should read on different css properties for links.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top