
16-08-2006, 13:12
|
|
|
|
חבר מתאריך: 17.05.05
הודעות: 7,321
|
|
|
כל כך פשוט ולא מצליח - בעיית CSS - קשור ל- hover:
יש לי את הקוד הבא (העתיקו ל-Notepad ושמרו כקובץ HTML שיהיה יותר קל):
קוד:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir='rtl' xml:lang="en" lang="en" xmlns=" http://www.w3.org/1999/xhtml">
<head>
<title>Trying</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1255" />
<!-- CSS Script -->
<style type="text/css">
.tableIt
{
background-color:#ebedef;
color:white;
margin:4px auto;
font-family: Tahoma, sans-serif, Verdana, Arial;
font-size:11px;
font-weight:bold;
}
.tableIt td
{
background-color:black;
color:white;
}
.tableIt td:hover
{
background-color:#ebedef;
color:red;
}
</style>
</head>
<body>
<table class='tableIt' cellspacing='1' cellpadding='6'><tr>
<td>Go grey</td>
<td>Go grey 2 (plz) </td>
</tr></table>
</body>
</html>
קוד פשוט ביותר. הבעיה היא בחלק של ה-CSS, כאן:
קוד:
.tableIt td:hover
{
background-color:#ebedef;
color:red;
}
משום מה כשאני עובר עם העכבר על התא, הוא לא מחליף את הצבע שלו לאפור (ב- #ebedef הכוונה לאפור) ואת הכתב לאדום.
מה לא נכון בקוד?
|