|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with link colors
Hi there, is that possible to change the link colors on this code? it's working, but the link colors are the default ones.
[BEGIN XML FILE "bandnews2004.xml":] <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="bandnews2004.xsl"?> <BANDNEWS> <BNEWS> <DATE>10/07/2004</DATE> <TEXT>HERE'S A SAMPLE TEXT 01</TEXT> </BNEWS> <BNEWS> <DATE>14/06/2004</DATE> <TEXT>HERE'S A SAMPLE TEXT 02 <a href="#">HERE'S A SAMPLE LINK</a> HERE'S A SAMPLE TEXT 02 HERE'S A SAMPLE TEXT 02 </TEXT> </BNEWS> </BANDNEWS> [END XML FILE "bandnews2004.xml"] [BEGIN XSL FILE "bandnews2004.xsl"] <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <html> <head> <title>Band News 2004</title> <style> .date { width: 602px; height: 2em; line-height: 2em; color: white; background: black; border: 1px black solid; } img { padding: 0 5px 0 5px; } .text { width: 602px; height: auto; border: 1px black solid; } </style> </head> <body> <xsl:for-each select="//BNEWS"> <xsl:sort select="DATE" /> <div class="date"> <img src="your_icon.gif" /> <xsl:value-of select="DATE" /> </div> <div class="text"><xsl:copy-of select="TEXT" /></div> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> [END XSL FILE "bandnews2004.xsl"] thx a lot! |
|
#2
|
|||
|
|||
|
your style must be like this:
.date a:link, .date a:active, .date a:visited { color: #FF0000; text-decoration: none } .date a:hover { color: #00FF00; text-decoration: none } You can also separate them if you want 4 different colors, but these 4 are the events on which you have control. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Help with link colors |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|