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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why Am I hovering text only and not entire cell?

Status
Not open for further replies.
I can tell you now that your anchor tag is not shown as display:block. Anchor tags are inline elements so the hover will only cover the items within the anchor tags. Put display:block on your anchor tags in the navigation area, and you may have to specify a width and height as well, but it should take care of it.

<.
 
not sure exactly where I need to put the display:block attribute?
 
Right here:

Code:
<style type="text/css">
<!--
[!].bluelink a {display:block;}[/!]
.bluelink a:link {text-decoration: none; color: #0000FF;}
.bluelink a:visited {text-decoration: none; color: #0000FF;}
.bluelink a:active {
	text-decoration: none;
	color: #0000FF;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
.bluelink a:hover {text-decoration: none; color: #0000FF;}
-->
</style>
<!-- For Black Link Colors in Menu Nav Bar and Menu Box -->
<style type="text/css">
<!--
[!].blacklink a {display:block;}[/!]
.blacklink a:link {text-decoration: none; color:#000000;}
.blacklink a:visited {text-decoration: none; color: #000000;}
.blacklink a:active {
	text-decoration: none;
	color: #000000;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
.blacklink a:hover {text-decoration: none; color: #000000;}
-->
</style>

<.
 
TYVM. It works.

However I had to do it in the .rollover css not the black or bluelinks.

awesome,

thank u

Code:
<style type="text/css">
<!--
.rollover a {display:block;}
.rollover a:hover {
	text-decoration: none;
	background-color: #7BB992;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
.rollover ul {list-style-type: none;}
.rolllover p {
	margin:0px;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>
 
Taking a look at it, you may want to specify a width and height on the anchor tags (not so much the height as the width) so that you don't have to exactly mouseover the text to pop up the highlight. That you would do where I specified by mistake earlier in the CSS (blacklinks and bluelinks).

However, that's just a matter of taste.

<.
 
yeah I was just looking at that. I want the mouseover effect to be on the whole table cell, not just the text. Its weird the first td changes color anywhere in the box when the rest of them dont.

I will look at fixing now.

thanks again

Mike
 
Why do you say that it needs to be in the bluelinks and blacklinks section? Those css are basically just to have the color of my links black in the menu box and nav drop-downs. Everything else on the page in the main body section of the page will be blue as normal.

anyways I tried adding

Code:
.rollover a {display:block; width;151;}

both into the blacklink css and the rollover css and it didnt work. is that the right syntax? 151 is the width of the cells in that table
 
got it. didnt have the px in there

Code:
 .rollover a {display:block; width;151px;}
 
Code:
 .rollover a {display:block; width[red]:[/red]151px;}

Also you may need to change the semicolon to a colon as denoted in red
 
After looking at your code, it appears you only need to add it to the .blacklink class declaration. I'm saying to apply to .blacklink because it's best not to resize the anchor tag on a hover.



The following code doesn't even need to be written as such, for most it is easier to understand to change this:

Code:
.rollover a {display:block;}
.rollover a:hover {
	text-decoration: none;
	background-color: #7BB992;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
to this:
Code:
.blacklink a {display:block;}
.blacklink a:hover {
	text-decoration: none;
	background-color: #7BB992;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}

and the declaration for width is this:

Code:
.blacklink a {
   display:block; 
   width[!]:[/!]151[!]px[/!];
}



<.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top