homepage Welcome to WebmasterWorld Guest from 54.226.213.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Mysterious disappearing text
Float and a:hover affecting visibility of text
AWildman




msg:3180469
 7:33 pm on Dec 6, 2006 (gmt 0)

Okay, I've a real doozy of a problem. I have a normal html page. Validates 4.01 strict. CSS validates.

On this page, there is an image rollover. Here's the relevant css

.apply
{
position: relative;
font-family: arial, helvetica, sans-serif;
background: url(../images/apply_button_ovr.gif) no-repeat;
white-space: nowrap;
display: block;
width: 172px;
height: 29px;
margin: 12px 8px 0px 0px;
padding: 0;
}

.apply a
{
display: block;
color: #000000;
font-size: 11px;
width: 172px;
height: 29px;
display: block;
float: left;
color: black;
text-decoration: none;
}

.apply img{width: 172px; height: 29px; border: 0px;}

* html a:hover{visibility: visible;}

.apply a:hover img{visibility: hidden;}

#apply
{
position: relative;
font-family: arial, helvetica, sans-serif;
background: url(../images/apply_button_ovr.gif) no-repeat;
white-space: nowrap;
display: block;
width: 172px;
height: 29px;
margin: 5px 8px 0px 0px;
padding: 0;
}

#apply a
{
display: block;
color: #000000;
font-size: 11px;
width: 172px;
height: 29px;
display: block;
float: left;
color: black;
text-decoration: none;
}

#apply img{width: 172px; height: 29px; border: 0px;}

#apply a:hover img{visibility:hidden;}

I found this on a site as a nifty way to do a css rollover. Works fine most everywhere.

However, I have a page on which there is one left column and one right floated column. If I hover over a certain link on the page, all the text below the right floated column disappears, the page height shrinks to the size of the left hand nav but there is a large space underneath the footer about the same length as the text that disappeared. If I rollover a link in the right-floated column, the text reappears correctly. Here's the css for the link that causes the text to disappear.
#breadcrumbs, #breadcrumbs a{text-decoration: none; font-size: x-small;}

I commented out the apply button rules dealing with visibility and found that the page stopped working as soon as I uncommented this line:
* html a:hover{visibility: visible;}

BUT, if I remove the right floated div, then I don't have the problem, even when this line is active. So it is some odd combo of the two. The css for the right-floated div is:
.rightnav{float: right; width: 40%; padding: 0px; margin: 0px; background: #cccc99;}

.rightnav ul{list-style-type: none; margin: 0px; padding: 5px 0px;}

.rightnav ul li{border-bottom: #ffffff solid 1px; padding: 3px 5px;}

.rightnav a{text-decoration: none;}

The problem only occurs in I.E. 6x. What might I be doing wrong? HELP!

[edited by: AWildman at 7:34 pm (utc) on Dec. 6, 2006]

 

AWildman




msg:3180534
 8:59 pm on Dec 6, 2006 (gmt 0)

Interesting side note...if I comment out the breadcrumbs and rightnav classes, the problem happens but in reverse. Then, hovering over the link in the breadcrumb does not make the text disappear, but hovering over a link in the rightnav does make the text disappear. GAH!

**FIXED IT! I replaced:
* html a:hover {visibility: visible;}
with:
.apply a:hover {visibility: visible;}

Just in case anyone else runs across that handy little trick but has problems down the line!

[edited by: AWildman at 9:15 pm (utc) on Dec. 6, 2006]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved