Creation: focusing work in ie7 with css?

Is there a simple hack for this? I would rather avoid javascript.

+2


a source to share


3 answers


In this case, JavaScript is a simple hack. Take a look at the ie7-js project .

IE7.js is a JavaScript library for making Microsoft Internet Explorer behave like a standards-compliant browser. This fixes many HTML and CSS issues and makes transparent PNG work correctly under IE5 and IE6.

Update MSIE5.5-7 to be compatible with MSIE8.



<!--[if lt IE 8]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
<![endif]-->

      

You can also refer to this SO question . IE7 does not support this pseudo-class .

+1


a source


IE6 / 7 does not support any :focus

You can use this jQuery snippet to handle :focus

for these:

jQuery(function($) {
    $(".block div").bind('focus blur',function(){$(this).toggleClass('focus')});
});

      



Using:

.block div:focus { background: #ccc; } /* For all browser, except IE6/7 */
.block div.focus { *background: #ccc; } /* For IE6/7 */

      

You must repeat all styles for :focus

on a new line. And don't forget the stellar hack - *

+5


a source


For ie6 you can use: active, but ie7 you need javascript

+2


a source







All Articles