HOVER underline
Ik zet de code erbij zoals die dus niet werkt. Is er iemand die me kan vertellen hoe die wel werkt?
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?
$amount=50;
if ($_GET['action']=='write') {
$file=fopen('gastenboek.txt','a');
$message = str_replace(array("\r\n","\r","\n"), '<br />',stripslashes ($_GET['message']));
fwrite($file,$message."\n");
fclose($file);
header('location: gastenboek.php?action=read&start=0');
}
$start=(isset($_GET['start'])?$_GET['start']:0);
$gastenboek=Array();
$gastenboek=file('gastenboek.txt');
?>
<style>
#message{
width: 100%;
height: 80px;
font-family: Arial;
overflow: auto;
}
TD, textarea {
font-family:Arial;
font-size: 1em;
}
a {text-decoration: none;
} a:hover { text-decoration: underline;
} a:active {text-decoration: none;
} a:archive {text-decoration: none;}
</style>
<HTML>
<HEAD>
<TITLE>Gastenboek</TITLE>
<!--
Gebruik de volgende script tag als je het SUR-script van CoR.nl wilt gebruiken
<SCRIPT language="JavaScript" src="sur.js" type="text/javascript"></SCRIPT>
Verwijder dan ook de twee slashes (//) in de onLoad van de BODY-tag
-->
<SCRIPT language="JavaScript">
function validate(form) {
if (form.name.value=="") {
alert("Vul je naam in");
return false;
} else if (form.message.value=="") {
alert("Vul je bericht in");
document.getElementById('message').focus();
return false;
}
}
</SCRIPT>
</HEAD>
<body onload="document.getElementById('message').focus()" topmargin="40" bgcolor="#000000" background="/images/backgrnd1.gif" leftmargin="20" topmargin="40">
<center>
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr><td align="center"><INPUT TYPE=button VALUE="Button"
onClick="location.href='index.htm'" style="font-family: Arial" title="Go to the main page">
</td></tr>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="25">
<TABLE width="748" style="border-style:solid; border-width:1; border-collapse: collapse" cellpadding="20" cellspacing="0" id="AutoNumber1" bordercolor="#000000" bgcolor="#FFFFFF">
<TR><TD class="conttd">
<FORM action="gastenboek.php" method="GET" onSubmit="return validate(this);">
<INPUT type="hidden" name="action" value="write">
<TEXTAREA name="message" id="message" cols="85" rows="5" style="border-collapse: collapse; border: 0px solid #000000;"></TEXTAREA></TD></TR>
<tr><td align="right"><INPUT type="submit" style="font-family: Arial" size="3" value="Verstuur" title="Klik hier om je bericht te plaatsten"></TD></TR>
</FORM>
</TD></TR>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="20">
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr><td><img border="0" src="images/spacer.gif" width="1" height="20"></td></tr>
<tr>
<td valign="middle" style="border-style:solid; border-width:1; border-collapse: collapse" bordercolor="#000000" bgcolor="#FFFFFF">
<img border="0" src="images/spacer.gif" width="1" height="10">
<CENTER>
<?
if ($start+$amount<sizeof($gastenboek)) echo ' <b><A href="gastenboek.php?start='.($start+$amount).'"style="text-decoration: none"><font color="#000000">vorige</A>';
if ($start>0) echo '<A href="gastenboek.php?start='.max(0,$start-$amount).'"style="text-decoration: none"><font color="#000000"> volgende</b></A>';
?>
</CENTER>
<img border="0" src="images/spacer.gif" width="1" height="10">
</TD>
</TR>
</TABLE>
<TABLE width="748" cellspacing="0" cellpadding="20" style="border-style:solid; border-width:1; border-collapse: collapse" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td>
<TABLE BORDER= "0" cellspacing="0" cellpadding="0" style="font-family:Arial;" "border-style:none border-collapse: collapse" bgcolor="#FFFFFF">
<tr>
<td>
<?
$gastenboek=array_reverse($gastenboek);
for ($i=$start;$i<$start+$amount && $i<sizeof($gastenboek);$i++) {
list($name,$email,$date,$url,$message)=explode('|||',$gastenboek[$i]);
$message=str_replace('{{',"\n",$message);
echo '<TR><TD>'.($email!=""?'<A href="mailto:'.$email.'">'.$name.'</A>':$name).'</B></TD><TD align="right"></B> </FONT> '.$date.'</B></P></TD></TR>'."\n";
echo ($url!=""?'<TR><TD colspan="2"><A href="'.$url.'" target="_blank">'.$url.'</A></TD></TR>':'')."\n";
echo '<TR><TD colspan="2"><SPAN class="SUR">'.str_replace("\n",'<BR>' ,htmlspecialchars($message)).'</SPAN></TD></TR>'."\n";
echo '<TR><TD colspan="2"><HR NOSHADE color="#000000" size="1"></TD></TR>'."\n";
}
?>
</td>
</tr>
</TABLE>
</td>
</tr>
</TABLE>
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" style="border-style:solid; border-width:1; border-collapse: collapse" bordercolor="#000000" bgcolor="#FFFFFF">
<img border="0" src="images/spacer.gif" width="1" height="10">
<CENTER>
<?
if ($start+$amount<sizeof($gastenboek)) echo ' <b><A href="gastenboek.php?start='.($start+$amount).'"style="text-decoration: none"><font color="#000000">vorige</A>';
if ($start>0) echo '<A href="gastenboek.php?start='.max(0,$start-$amount).'"style="text-decoration: none"><font color="#000000"> volgende</b></A>';
?>
</CENTER>
<img border="0" src="images/spacer.gif" width="1" height="10">
</TD>
</TR>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="40">
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><INPUT TYPE=button VALUE="Button"
onClick="location.href='index.htm'" style="font-family: Arial" title="Go to the main page">
</td>
</tr>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="25">
</center>
</BODY>
</HTML>
$amount=50;
if ($_GET['action']=='write') {
$file=fopen('gastenboek.txt','a');
$message = str_replace(array("\r\n","\r","\n"), '<br />',stripslashes ($_GET['message']));
fwrite($file,$message."\n");
fclose($file);
header('location: gastenboek.php?action=read&start=0');
}
$start=(isset($_GET['start'])?$_GET['start']:0);
$gastenboek=Array();
$gastenboek=file('gastenboek.txt');
?>
<style>
#message{
width: 100%;
height: 80px;
font-family: Arial;
overflow: auto;
}
TD, textarea {
font-family:Arial;
font-size: 1em;
}
a {text-decoration: none;
} a:hover { text-decoration: underline;
} a:active {text-decoration: none;
} a:archive {text-decoration: none;}
</style>
<HTML>
<HEAD>
<TITLE>Gastenboek</TITLE>
<!--
Gebruik de volgende script tag als je het SUR-script van CoR.nl wilt gebruiken
<SCRIPT language="JavaScript" src="sur.js" type="text/javascript"></SCRIPT>
Verwijder dan ook de twee slashes (//) in de onLoad van de BODY-tag
-->
<SCRIPT language="JavaScript">
function validate(form) {
if (form.name.value=="") {
alert("Vul je naam in");
return false;
} else if (form.message.value=="") {
alert("Vul je bericht in");
document.getElementById('message').focus();
return false;
}
}
</SCRIPT>
</HEAD>
<body onload="document.getElementById('message').focus()" topmargin="40" bgcolor="#000000" background="/images/backgrnd1.gif" leftmargin="20" topmargin="40">
<center>
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr><td align="center"><INPUT TYPE=button VALUE="Button"
onClick="location.href='index.htm'" style="font-family: Arial" title="Go to the main page">
</td></tr>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="25">
<TABLE width="748" style="border-style:solid; border-width:1; border-collapse: collapse" cellpadding="20" cellspacing="0" id="AutoNumber1" bordercolor="#000000" bgcolor="#FFFFFF">
<TR><TD class="conttd">
<FORM action="gastenboek.php" method="GET" onSubmit="return validate(this);">
<INPUT type="hidden" name="action" value="write">
<TEXTAREA name="message" id="message" cols="85" rows="5" style="border-collapse: collapse; border: 0px solid #000000;"></TEXTAREA></TD></TR>
<tr><td align="right"><INPUT type="submit" style="font-family: Arial" size="3" value="Verstuur" title="Klik hier om je bericht te plaatsten"></TD></TR>
</FORM>
</TD></TR>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="20">
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr><td><img border="0" src="images/spacer.gif" width="1" height="20"></td></tr>
<tr>
<td valign="middle" style="border-style:solid; border-width:1; border-collapse: collapse" bordercolor="#000000" bgcolor="#FFFFFF">
<img border="0" src="images/spacer.gif" width="1" height="10">
<CENTER>
<?
if ($start+$amount<sizeof($gastenboek)) echo ' <b><A href="gastenboek.php?start='.($start+$amount).'"style="text-decoration: none"><font color="#000000">vorige</A>';
if ($start>0) echo '<A href="gastenboek.php?start='.max(0,$start-$amount).'"style="text-decoration: none"><font color="#000000"> volgende</b></A>';
?>
</CENTER>
<img border="0" src="images/spacer.gif" width="1" height="10">
</TD>
</TR>
</TABLE>
<TABLE width="748" cellspacing="0" cellpadding="20" style="border-style:solid; border-width:1; border-collapse: collapse" bordercolor="#000000" bgcolor="#FFFFFF">
<tr>
<td>
<TABLE BORDER= "0" cellspacing="0" cellpadding="0" style="font-family:Arial;" "border-style:none border-collapse: collapse" bgcolor="#FFFFFF">
<tr>
<td>
<?
$gastenboek=array_reverse($gastenboek);
for ($i=$start;$i<$start+$amount && $i<sizeof($gastenboek);$i++) {
list($name,$email,$date,$url,$message)=explode('|||',$gastenboek[$i]);
$message=str_replace('{{',"\n",$message);
echo '<TR><TD>'.($email!=""?'<A href="mailto:'.$email.'">'.$name.'</A>':$name).'</B></TD><TD align="right"></B> </FONT> '.$date.'</B></P></TD></TR>'."\n";
echo ($url!=""?'<TR><TD colspan="2"><A href="'.$url.'" target="_blank">'.$url.'</A></TD></TR>':'')."\n";
echo '<TR><TD colspan="2"><SPAN class="SUR">'.str_replace("\n",'<BR>' ,htmlspecialchars($message)).'</SPAN></TD></TR>'."\n";
echo '<TR><TD colspan="2"><HR NOSHADE color="#000000" size="1"></TD></TR>'."\n";
}
?>
</td>
</tr>
</TABLE>
</td>
</tr>
</TABLE>
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr>
<td valign="middle" style="border-style:solid; border-width:1; border-collapse: collapse" bordercolor="#000000" bgcolor="#FFFFFF">
<img border="0" src="images/spacer.gif" width="1" height="10">
<CENTER>
<?
if ($start+$amount<sizeof($gastenboek)) echo ' <b><A href="gastenboek.php?start='.($start+$amount).'"style="text-decoration: none"><font color="#000000">vorige</A>';
if ($start>0) echo '<A href="gastenboek.php?start='.max(0,$start-$amount).'"style="text-decoration: none"><font color="#000000"> volgende</b></A>';
?>
</CENTER>
<img border="0" src="images/spacer.gif" width="1" height="10">
</TD>
</TR>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="40">
<TABLE width="748" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><INPUT TYPE=button VALUE="Button"
onClick="location.href='index.htm'" style="font-family: Arial" title="Go to the main page">
</td>
</tr>
</TABLE>
<img border="0" src="images/spacer.gif" width="1" height="25">
</center>
</BODY>
</HTML>
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
a:archive {
text-decoration: none;
}
zou wel moeten werken. Alleen archive ken ik niet? Bedoel je daarmee 'visited'?
<style>
#message{
width: 100%;
height: 80px;
font-family: Arial;
overflow: auto;
}
TD, textarea {
font-family:Arial;
font-size: 1em;
}
a.type1:link {
text-decoration: none;
}
a.type1:visited {
text-decoration: none;
}
a.type1:active {
text-decoration: none;
}
a.type1:hover {
text-decoration: underline;
}
</style>
En dan bijv zo de verwijzing naar de hover:
if ($start+$amount<sizeof($gastenboek)) echo ' <b><a class="type1" href="gastenboek.php?start='.($start+$amount).'"style="text-decoration: none"><font color="#000000">vorige</A>';
if ($start>0) echo '<a class="type1" href="gastenboek.php?start='.max(0,$start-$amount).'"style="text-decoration: none"><font color="#000000"> volgende</b></A>';
?>
Maar werken doet het niet.
hebtal