-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
visuallyhidden sometimes cause a horizontal scrollbar on IE7 #194
Comments
If we want to correct for every seemingly-reasonable possibility of overflow in every browser then we may want to consider.
And I know !important is so ugly, but we're hacking here. There is no available property that would do what I've tested this class successfully in JAWS 12 and VoiceOver for Mac. |
why use "clip" if using all the rest? |
The 0 clipping will avoid the potential 1x1 visible pixel speck. |
This is why i use height:1px;margin-top:-1px;overflow:hidden; . |
We need |
Oh... never tested this with a background, you are right. |
reopening this so we can fix this in the css first... |
I had the same problem, but with Safari and Chrome (and IE9 too). In my case the element with the visuallyhidden class had some large width (set by a different selector) and that's what was causing the scrollbar. I could easily solve it adding a |
I feel very comfortable changing it to
How's this sound to everyone? |
About height: |
nope.. can you try it out? |
busy week at work, but i'll try to find the time for an experiment. |
|
|
Updated visuallyHidden rule to make sure it overrides all other declarations. Thanks Jonathan Neal. Closed by 07768ed |
Note: The classname uses an inconsistent camelcase. Needs to be updated to use lowercase. |
Fixed by 6da1bd8 |
…rations. Thanks Jonathan Neal. Fixes #194
I just found an IE7 horizontal scrollbar problem that is fixed when I replace the
with the CSS from 'Visually Hidden: Level 4 Combined' #194 (comment) (this):
As a newbie here I hope it was OK that I just dropped in and added this comment. |
@alanfluff, the only difference between the two is that in latter |
Thanks cust0dian, I'll check the actual CSS. I did check in the SASS (that I am new to) that this and the other helper classes came last but of course it's how the CSS looks that counts so maybe it's my SASS use. I'll try to check and comment. Cheers. |
@cust0dian I have two stylesheets the second one was IE specific, the first included the helper classes so I thought that was it and swapped them around. But the problem is still there for IE7. I'm surprised :/ I really thought that would have been the reason. In case it helps, this is the particular tag that is causing the problem for IE7:
The site is on a local dev platform tied into a CMS and so not easy to move online, but if there's any more I can tell you/others to help see if this is a real issue or not, just say the word. |
Just as an experiment and in case it helped explain I wondered if this might work:
and it does—that is the standard CSS from H5BP 3.0.1 does not cause a horizontal scrollbar in IE7 when the I don't suggest this is the answer, just thought I'd note it in case it helps. |
Do scrollbars appear in this test case? (I don't have IE7 right now.) |
@cust0dian No, neither in jsFiddle nor in a test page made from it:
|
@alanfluff, then it's something in your CMS styles or somewhere that selects IMG element and overwriting overflow property. Definitely not H5BP causes it. Just stick with wrapper DIV and you should be fine. |
@cust0dian THANK you and sorry to have bothered the thread with this, glad it's me. |
Dev deps update
Paul's note: the original visuallyHidden technique is from Jonathan Neal.. it's an iteration of research here http://www.webaim.org/techniques/css/invisiblecontent/ and it was first published here: http://j.mp/visuallyhidden
Below we encounter some edge case issues and revise it again.
I encountered an edge case when I used visuallyHidden on an element wider than the page in IE7.
I don't have a test case to show right now (I fixed the bug), but I'll try to describe it:
In a page header I had the following structure:
Example HTML:
Example CSS:
The result of this setup was that the hidden H1 (doesn't matter why is it hidden on this page) is floated after the
nav
element.Because visuallyHidden applies
position:absolute
on the element, the text in the H1 does not break, and on IE7 only (Not even on IE6) it's origin is right after the nav menu and it widens the page and causes a horizontal scrollbar.My immediate solution for this issue was to add
left:0
to visuallyHidden, but if the text inside the H1 was a bit wider it would widen the page again.I don't really understand why
clip
is better than other methods, before h5bp I used to use this:and it worked perfectly. (for example, look for the the hidden accessibility links and hidden H2 headers on this old demo: http://tendu.tombigel.com)
The text was updated successfully, but these errors were encountered: