clonetrooper9494 Posted April 21, 2009 Share Posted April 21, 2009 For some reason, CSS :hover isn't working for DIV elements. In the CSS I have, it says .file-cell:hover{border-color:black;}, but it is not affecting any of the DIV elements! I remember reading that you can do this, so why isn't it working?Plus, in IE, none of the CSS works on the DIVs correctly, why is this?!http://clonedrone.com/php-lab/installation...S/file_test.php <html><head><title>File Test</title><style type="text/css">body *{line-height:1.32em;}a:hover{color:red;}.file-handle{border:1px solid black;margin:0;padding:0;width:656px;height:300px;}.file-cell{border:1px solid white;width:60px;//height:63px;padding:5px;margin:5px;float:left;text-align:center;}.file-cell:hover{border-color:black;}.file-image{border:1px solid black;width:32px;height:32px;}.file-text{border:1px solid black;width:47px;height:50px;}</style></head><body><div class="file-handle"><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div><div class="file file-cell"> <img src="http://alxa.ru/file/icons/text_edit.jpg" class="file file-image"> <a href="#">Text 1</a></div></div></body></html> Link to comment Share on other sites More sharing options...
chibineku Posted April 21, 2009 Share Posted April 21, 2009 I think you need a strict doctype Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted April 21, 2009 Author Share Posted April 21, 2009 Ok, I did that, and now there is a problem with another page! I put that doctype on http://clonedrone.com/php-lab/installation...window_test.php, and now you can't drag and drop any of the DIVs, why is this? Notice how you can on http://clonedrone.com/php-lab/installation...t_nodoctype.php, but not on http://clonedrone.com/php-lab/installation...window_test.phpAny way I can get both to work? Link to comment Share on other sites More sharing options...
Ingolme Posted April 21, 2009 Share Posted April 21, 2009 I believe the border: shorthand property gets overwritten by border-color.I know that the background: property is cleared when using background-color, background-image, or background-position. I'm pretty sure it's the same with the border property.Try border: 1px solid black;Also, you need a Strict DTD to make it work in IE7.Either <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> or <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Link to comment Share on other sites More sharing options...
Ingolme Posted April 21, 2009 Share Posted April 21, 2009 Ok, I did that, and now there is a problem with another page! I put that doctype on http://clonedrone.com/php-lab/installation...window_test.php, and now you can't drag and drop any of the DIVs, why is this? Notice how you can on http://clonedrone.com/php-lab/installation...t_nodoctype.php, but not on http://clonedrone.com/php-lab/installation...window_test.phpAny way I can get both to work? Edited: my mistake, I'm looking through the code againUpdate:In valid CSS, all values must have units:handle.style.left = (tempX - tempX2) + "px";handle.style.top = (tempY - tempY2) + "px"; Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted April 21, 2009 Author Share Posted April 21, 2009 EDIT: Oops, I didn't notice you posted again! Ok, that works Ingolme, Thanks!And Fabs? what was the point of that post?! Link to comment Share on other sites More sharing options...
fabs Posted April 21, 2009 Share Posted April 21, 2009 iam still beginner in css.so i cannot answer this question Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.