This content originally appeared on CSS-Tricks and was authored by Chris Coyier
On a default left-to-right web page, “hanging” an element off the right side of the page (e.g. position: absolute; right: -100px;
) triggers a horizontal scrollbar that scrolls as far as needed to make that whole element visible. But if you hang an element of the left side of the page, it’s just hidden (no scrollbar is triggered). That’s called “data loss” in CSS terms, if you’re fancy. The same is true for the top edge of the page (hidden) and bottom of the page (scrolling happens).
Ahmad puts a point on this. It’s just one of those CSS things that you just need to know. I love how Ahmad uses logical directions like inline-start
direction (and block-start
direction) to describe the issue because those directions change when the direction or writing mode of the page changes. If the page is right-to-left (RTL) like <html dir="rtl">
, then horizontal edges where the data loss occurs are flipped (except in Firefox 🤷♀️).
Direct Link to Article — Permalink
The post Clipping Scrollable Areas On The inline-start Side appeared first on CSS-Tricks.
You can support CSS-Tricks by being an MVP Supporter.
This content originally appeared on CSS-Tricks and was authored by Chris Coyier
Chris Coyier | Sciencx (2021-02-19T22:32:01+00:00) Clipping Scrollable Areas On The inline-start Side. Retrieved from https://www.scien.cx/2021/02/19/clipping-scrollable-areas-on-the-inline-start-side-2/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.