3

My Issue:

The code below works for me in FireFox and Google Chrome, but in IE the button does not change colors. could someone show me how I can fix this issue. Any Suggestions? My input element:

<input id="pmunch" type="submit" value="Post It!"/>

The CSS relevant to this element:

#pmunch{
width:240px;
height:28px;
padding:2px 4px;
margin-left:24px;
font-family:‘Lucida Console’, Monaco, monospace;
font-size:18px;
border:none;
float:left;
background-color:turquoise;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
#pmunch:hover{
background-color:khaki;
color:green;
cursor:pointer;
}
9
  • 2
    I don't think IE likes the :hover pseudo-class on anything other than <a> tags Commented Feb 28, 2011 at 5:21
  • @Shad: You are correct. But the OP really needs to describe the error more. Commented Feb 28, 2011 at 5:24
  • IE6 doesn't like it. IE8 doesn't mind it at all, last i tried it. Commented Feb 28, 2011 at 5:24
  • 2
    @Shad: Any version of IE greater than 6 is fine with :hover on other elements. Commented Feb 28, 2011 at 5:24
  • I described the issue I am sorry! Commented Feb 28, 2011 at 5:25

1 Answer 1

10

One thing i've noticed is that if the browser is in quirks mode (ie: if you don't have a doctype line at the top of the page), IE -- even IE8 -- doesn't like :hover on anything but links.

Even <!DOCTYPE html> is enough to trigger standards mode. Add that if it isn't already there.

Sign up to request clarification or add additional context in comments.

2 Comments

A likely candidate. I suspect this is the problem, but I was hoping he'd post his code so I could be sure. Oh well.
That was it Thanks! And thank you everyone else for helping me out to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.