Using .sr-only inside a responsive table creates white space outside of body
See original GitHub issueDescription
Giving an element descended from .table-responsive
the .sr-only
class will cause the browser window to scroll horizontally due to .sr-only
’s position: absolute
.
I checked the docs and don’t see any limitations of using .sr-only
listed. https://getbootstrap.com/docs/4.5/utilities/screen-readers/
Is there a workaround or can something be added to the docs?
Reduced test case
Reduce the browser width to its smallest and notice that the browser window scrolls, revealing white space to the right of the table. If you remove the .sr-only
class from the top-right table cell, things behave normally.
https://www.codeply.com/v/0xzRkENQaH
Config
- Bootstrap 4.5.2
- macOS 10.15.7
- Safari 14.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Getting white space on the right side on mobile device. Some ...
I'm getting strange white space on the right side of the mobile devices. I tried wrapping the page inside the body the following:...
Read more >Responsive Data Tables | CSS-Tricks
We're going to use “responsive design” principles (CSS @media queries) to detect if the screen is smaller than the maximum squishitude of our ......
Read more >Bootstrap 4 table responsive - examples & tutorial.
Table columns with text-nowrap. With the class . text-nowrap you can specify how white-space inside a table is handled. Sequences of white space...
Read more >Getting Rid of Spaces in HTML Tables - ThoughtCo
Fix white-space problems with HTML tables by checking the HTML and relevant stylesheets but if you're using a table for page design, use...
Read more >How To Create A Responsive Table - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
coming back to this a bit late, but: would adding the
position: relative
in bootstrap’s core CSS cause any other unforeseen problems? if not, we could probably add it directly.are there any other situations where the
.sr-only
/.visually-hidden
class would cause similar problems, do we know?If this is still an issue in v5, could this please be reopened and relabeled?