a:hover (adjusting text color) not working! :(
Posted: 19 May 2008 04:29 PM   [ Ignore ]
Newbie
Rank
Total Posts:  1
Joined  2008-05-19

Well I am very new to CSS and am having some trouble getting the a:hover to work…or at least be consistent… I am running mac OSX and have Safari and Firefox, the a:hover does not work on this…Ive seen on a friends windows computer that SOME of the links on my site came up and some did not… I have a windows laptop (running vista) and none of the link color changes. This is the CSS code that I have used.

}

a:hover {
color: #4B9397;
}

the style sheet can be found at http://www.sheffieldfurniture.com/styles.css and the site of course is http://www.sheffieldfurniture.com Thanks in advance everyone

NOTE: The top menu on my page is FLASH so obviously that DOES work, I’m having trouble with all the non flash ones :) (bottom of the page as well as all the submenus on the pages)

Profile
 
 
Posted: 05 June 2008 03:27 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  1
Joined  2008-06-05

Hi!

In firefox 2.0.0.14 on XP your hover tag works (bottom menu) and it also works on IE 7.0.5730.13

However I think I have found an error in your css?

a img { border-style:none;

 

if you want that to apply to a and img tags you need a comma

However I suspect you want it to apply to image tags that are links and I’m not entirely clear how you would do that.
This does work a:hover.yourStyleName if you want to set the a:hover settings for img this doesn’t seem to work a:link/img

Profile
 
 
Posted: 05 June 2008 08:23 AM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  38
Joined  2007-09-03

I checked out your page in Firefox 1.5 and 2.0.0.14, Opera 9.1, Safari for Windows and IE6.  No problems with any of them - your links work just fine.

A few points regarding your stylesheet

a. You don’t need to specify attributes for the various pseudo classes (link, visited etc) separately.  Just doing a{color:#color;text-decoration:none} would apply the attributes to all a pseudo classes. With that done you can override the color for hover as a:hover{color:#COLOR}
b. If you want to change the way image links behave what you have done a img{... is correct.

Finally, a couple of useful links for you to checkout

W3C CSS Validator
View your site in more browsers than you could possibly install

Hope this helps.

Profile
 
 
Posted: 21 June 2008 09:38 PM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  2
Joined  2008-06-21

I’m having problems of my own with my hover color in Safari.

All my other hover properties work just fine (size/font/etc.), but the color is totally strange.  I’ve tried deleting the color-change part of the code, use the six-digit color name, use the css name, etc. - nothing works.  No matter what I do, the color just turns into some reddish-brown color.  I don’t have that color anywhere in my code.  Like I said, I even tried taking out the part of the code that changes the hover color, hoping it would stay the same as a regular link.  It still goes to reddish-brown.

I don’t think this is just a Safari/Mac problem - We use Internet Explorer/Windows at work, and the issue is the same.

Here is the part of the code with the link stuff:


<!—begin code provided by createblog.com—>
<html>

<head>

<meta http-equiv=“Content-Type” content=“text/html; charset=windows-1252”>
<meta name=“GENERATOR” content=“Microsoft FrontPage 4.0”>
<meta name=“ProgId” content=“FrontPage.Editor.Document”>

<title>carly.blog</title><style>

img {border: 0;}

a:link {
color:#434170;
text-transform: uppercase;
font-size: 9px;
text-decoration: none;
font-weight: bold;
font-family: Verdana;
  }

a:visited {
color:#434170;
text-transform: uppercase;
font-size: 9px;
text-decoration: none;
font-weight: bold;
font-family: Verdana;
  }

a:hover {
text-transform: lowercase;
color: #FFFFFF;
font-weight: normal;
font-size: 15px;
font-family: Palatino;
cursor: crosshair;
line-height: 11px;
  }

a:active {
text-transform: uppercase;
font-size: 9px;
text-decoration: none;
font-weight: bold;
font-family: Verdana;
  }


BODY {
background-color: #000000;
font-family: Verdana;
font-size: 10px;
text-align: justify;
color: #434170;
background: #000000 url(http://i7.photobucket.com/albums/y284/xSerenityLifex/MOONPREVIEW1.jpg?t=1190325256) bottom left;
background-repeat: no-repeat;
background-attachment: fixed;
}


And here is a link to the site: http://carlyfjm.blogspot.com/

Thanks, I hope you can help!!!

Profile
 
 
Posted: 23 June 2008 05:20 AM   [ Ignore ]   [ # 4 ]
Jr. Member
RankRank
Total Posts:  38
Joined  2007-09-03

Carly,

I looked at your code and noted the following issues with it

1. Missing DOCTYPE declaration - almost certainly nothing to do with the problem you are seeing but there is never any good reason for not specifying a DOCTYPE
2. No type = “text/css” attribute in your style tag on line 10. Again, nothing to do with the error you see but no good reason for leaving it out.
3. You do not need to specify pseudo-class styles separately.  i.e. you don’t need to do define a:link, a:visited etc separately.  Simply define a and then override just what you want changed - in your case the a:hover pseudo-class.
4. A mysterious </div> on line 165.  Any decent browser would ignore it but just what on earth is it doing there?
5. Lines 167, 168 and 174 - @import declarations tht bring in external style sheets.

This is almost certainly what lies at the root of the problem you are seeing. You will note that your anchor elements use the class “content-link”.  I was unable to locate it but I bet you that this is defined in one of those external stylesheets and all the browser is doing is faithfully obeying your instructions.  I copied your code and tried moving your own stylesheet declaration to line 175 and it worked perfectly - link color on hover and all.

I don’t know to what extent the use of Microsoft FrontPage is to blame for these errors - I have never used it and am not likely to. 

Anyway, hope this has been useful.

Profile
 
 
Posted: 23 June 2008 01:25 PM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  2
Joined  2008-06-21

Ahh thank you so much, it worked perfectly! =]

Profile
 
 
Posted: 24 April 2010 11:24 PM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  14
Joined  2010-04-22

Yes, this thread was so helpful. I really appreciate the detailed responses late last night when I was trying to figure it out.

Profile