在Internet Explorer 8中聚焦CSS标记 [英] Focus CSS tag in Internet Explorer 8

查看:112
本文介绍了在Internet Explorer 8中聚焦CSS标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让我很吃惊。

http://www.cssdrive.com/index.php/examples/exampleitem/focus_pseudo_class

这是一个使用悬浮伪类。适用于Chrome和IE。当我保存在本地它工作正常在Chrome,但不会在IE中工作。我错了!

This is an example of using the hover pseudo-class. Works fine in Chrome and IE. When I save locally it works fine in Chrome but won't work in IE. What am I doing wrong!?

<link rel="Stylesheet" href="style.css" />
<form>
    <p>1) Name:<br />
    <input type="text" size="40"></p>

    <p>2) Email address:<br />
    <input type="text" size="40"></p>

    <p>3) Comments:<br />
    <textarea rows="5" name="comments" cols="45" wrap="virtual"></textarea></p>

    <p><input id="actualsubmit" type="submit" value="Submit"></p>
</form>

style.css:

style.css:

input:focus, textarea:focus{
    background-color: lightyellow;
}   

编辑:
样式表正在应用 - 可以通过背景颜色:黑色。但是焦点效果不行。

The style sheet is applying - can be tested by background-color: black. But the focus effect is not working.

推荐答案

我认为IE8仍然不能正常支持它,
http://james.padolsey.com/javascript / fixing-focus-in-internet-explorer /

I believe that IE8 still doesn't support it properly, here's a JS workaround: http://james.padolsey.com/javascript/fixing-focus-in-internet-explorer/

这篇关于在Internet Explorer 8中聚焦CSS标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆