View Full Version : Hover for a div / table
Wisdom
07-26-2010, 06:41 PM
Hello again, this may seem like a newbie question, but I really don't know how to do a hover effect on a div or table.
I tryed for example a name class
.title{
background: none;}
.title:hover{
background: #FFF;}
and
<div class="title">Title</div>
But the hover din't work.
Can anybody help me ?
Thanks.
bluewalrus
07-26-2010, 06:54 PM
Did it not work in IE or in any browser? The background of the page isn't white right?
Wisdom
07-26-2010, 08:31 PM
It does not work in firefox, I guess it doesn't work in other browsers, and if your referring about the body{ background color, yes, it's black, but does it matter?
bluewalrus
07-26-2010, 08:50 PM
It works for me in FF. I have it as:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
.title{
background: none;}
.title:hover{
background: #00ff00;
}
</style>
</head>
<body>
<div class="title">Title</div>
</body>
</html>
There might be something else conflicting on your page. I mentioned the background of your page because as a white background you wouldn't be able to tell. Please post a link or the full code of the page for additional help.
azoomer
07-26-2010, 08:51 PM
It works fine in my firefox browser. Let's see your page, it may be something else preventing it from working.
Wisdom
07-26-2010, 10:19 PM
Thank you so much bluewalrus !
There is no link, I'm sorry, this is kind of a private projet, I din't have the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
And the endings, could you explain to me what they are exactly, if I'm asking to much :D
bluewalrus
07-26-2010, 11:03 PM
That tells the browser what kind of page is being loaded and what kind of encoding it uses.
For detailed explanations:
http://en.wikipedia.org/wiki/Doctype
http://en.wikipedia.org/wiki/UTF-8
http://en.wikipedia.org/wiki/Charset
Validating your pages will also help you finding these problems
http://validator.w3.org/
Wisdom
07-26-2010, 11:20 PM
Thank you again for your help, and the rest as well :D
Cheers
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.