GWT div aria-hidden 不隐藏在 IE 中 [英] GWT div aria-hidden not hiding in IE

查看:46
本文介绍了GWT div aria-hidden 不隐藏在 IE 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 GWT 编写了我的登录页面.在 IE 中,我在它的末尾得到了这个空带(我将它涂成绿色以便您可以看到它):

I programmed my landing page with GWT. In IE I get this empty band at the end of it (I painted it in green so that you can see it):

这只发生在 IE 中(我正在用 IE9 进行测试).不在 Chrome 中,不在 Firefox 中,不在 Safari 中.

This only happens in IE (I'm testing with IE9). Not in Chrome, not in Firefox, not in Safari.

查看DOM,负责这个区域的就是下面这个div:

Checking out the DOM, the responsible for this area is the following div:

出于某种原因,display:none;"内联规则不起作用.如果我取消选中它并再次检查它,那么绿色带消失了!!

For some reason, the "display:none;" inline rule is not working. If I uncheck it and check it back again, then the green band disappears!!

但是我不会要求我的用户每次加载我的登录页面时都这样做,所以有没有办法摆脱这个 div(显然是由 GWT 生成的),或者使内联样式display:none;"工作??

But I'm not gonna ask my users to do that each time they load my landing page, so is there a way to get rid of this div (apparently generated by GWT), or to make the inline style "display:none;" work??

谢谢!

补充说明:我没有编写 aria-hidden HTML div,它们是由 GWT 生成的.我只是观察到他们对我要移除的绿色带负责.观察结果来自这样一个事实:当我在 IE DOM 查看器中取消选中 display:none; 属性,然后再次检查它时,绿色带消失了.

Additional explanation: I didn't write the aria-hidden HTML divs, they were generated by GWT. I just observed that they are responsible for the green band that I want to remove. The observation comes from the fact that when I uncheck the display:none; property in the IE DOM viewer and then check it back again, the green band disappears.

推荐答案

根据我对 aria-hidden 和您的问题的理解,您可能错误地使用了该属性.该属性告诉使用屏幕阅读器的人忽略元素内的内容,应与 visibility:none 结合使用.有一个关于 通知用户一个现在可见的div,这可能是一个很好的阅读.接受答案的作者写了一个 博客文章关于它.

From what I am understanding about both aria-hidden and your question, you may be using the attribute incorrectly. The attribute tells people using screen readers to ignore the content within the element, and should be used in conjunction with visibility:none. There was a question about notifing users about a now visable div that may be a good read. The author of the accepted answer wrote a blog post about it as well.

这篇关于GWT div aria-hidden 不隐藏在 IE 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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