Forum Moderators: not2easy

Message Too Old, No Replies

background color change

I want to change the background color of a whole cell, not just the text.

         

ajthornton

10:36 pm on Apr 17, 2006 (gmt 0)

10+ Year Member



This is going to be a long post, so please bear with me. I am not new to html, but I am relatively new to CSS. I am attempting to teach myself. I am going to post *all* of my CSS and HTML files.

Here is what I want to do. I want to have the navigation area one color and when someone scrolls over the link, I want the entire background of the cell to change color and not just the background behind the text.

CSS
/* FORMAT THE TABLE */
body
{
background-color:black;
}
.maintabsetup
{
width:1000px;
border:1px solid lightgray;
margin-left:auto;
margin-right:auto;
padding:0px;
background-color:white;
}
.headertabsetup
{
width:1000px;
height:20px;
background-color:white;
margin:0px;
padding:0px;
border:0px;
}
.flashtabsetup
{
width:1000px;
height:150px;
background-color:white;
}
.navtabsetup
{
width:150px;
height:100%;
background-color:white;
}
.navrow
{
width:150px;
height:25px;
background-color:yellow;
}
.contenttabsetup
{
width:850px;
height:100%;
background-color:red;
}
.footertabsetup
{
width:1000px;
height:20px;
background-color:white;
}

.foottext
{
font-size:9px;
font-family:Trebuchet MS;
text-align:center;
letter-spacing:1px;
}
.headtext
{
font-family:Trebuchet MS;
font-size:10px;
margin-left:650px;
}

/* FORMAT THE FOOTER LINKS */
a.foot:link
{
text-decoration:blink;
color:green;
}
a.foot:visited
{
text-decoration:none;
color:yellow;
}
a.foot:hover
{
text-decoration:underline overline;
color:red;
}
a.foot:active
{
text-decoration:none;
}

/* FORMAT THE HEADER LINKS */
a.head:link
{
text-decoration:none;
color:black;
}
a.head:visited
{
text-decoration:none;
color:black;
}
a.head:hover
{
text-decoration:underline;
color:black;
}
a.head:active
{
text-decoration:none;
color:black;
}

HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="cfc.css" />
</head>
<body>
<table class="maintabsetup">
<tr>
<td class="headertabsetup" colspan="2"><!-- header row -->
<div class="headtext"><a class="head" href="http://www.example.com">Home</a></div>
</td>
</tr>
<tr>
<td class="flashtabsetup" colspan="2"><!-- flash row -->
FLASH
</td>
</tr>
<tr>
<td class="navtabsetup"><!-- nav row -->
<div class="navrow">NAVIGATION</div>
</td>
<td class="contenttabsetup"><!-- content row -->
CONTENT
</td>
</tr>
<tr>
<td class="footertabsetup" colspan="2"><!-- footer row -->
<div class="foottext">This site was created by A. Person of <a class="foot" href="http://www.example.com">Person Designs</a></dov>.
</td>
</tr>
</table>
</body>
</html>

All of what you see is a template that I am creating. If you have an answer to my problem please be specific with what I need to try.

Thanks in advance
A. James Thornton

[edited by: SuzyUK at 11:16 am (utc) on April 19, 2006]
[edit reason] removed specifics & URLs : see TOS #13 [WebmasterWorld.com] [/edit]

waffler

2:48 am on Apr 18, 2006 (gmt 0)

10+ Year Member



You may be able to do it similar to the following:

#links_div
{
background-color: #000000;
}

#links_div:hover
{
background-color: #ff0000;
}

Although this will not work correctly on Internet Explorer. For IE you will need a JavaScript onmouseover event to help out.

ajthornton

7:13 am on Apr 18, 2006 (gmt 0)

10+ Year Member



Am I able to do both the CSS and the mouseover? If yes then how. Also how do I do the HTML for the recommendation above?

James