Tom Walker on Nostr: #css This is nowhere on Stack Overflow (that I can see) so I'll put it here. This is ...
#css
This is nowhere on Stack Overflow (that I can see) so I'll put it here.
This is how to stop your page from scrolling horizontally without resorting to JS nonsense.
html, body {
max-width: 100%;
overflow-x: hidden;
position: relative; /* this is the one everyone misses out! */
}
The problem is that you have some position: absolute element poking out. position: relative at root level forces a 'container'.
Published at
2024-07-29 18:26:45Event JSON
{
"id": "0678f5ccb7e8d9b0afc31cdf41ee9beedf737e322d34e0b7f61c35cadd7d123d",
"pubkey": "01cf6009dc9a2a2a7029452898cbdcb50c91449ce757443f7472094cd9f44f31",
"created_at": 1722277605,
"kind": 1,
"tags": [
[
"t",
"css"
],
[
"proxy",
"https://mastodon.social/users/tomw/statuses/112871185164116390",
"activitypub"
]
],
"content": "#css \n\nThis is nowhere on Stack Overflow (that I can see) so I'll put it here.\n\nThis is how to stop your page from scrolling horizontally without resorting to JS nonsense.\n\nhtml, body {\n max-width: 100%;\n overflow-x: hidden;\n position: relative; /* this is the one everyone misses out! */\n}\n\nThe problem is that you have some position: absolute element poking out. position: relative at root level forces a 'container'.",
"sig": "4662c09eb01f7db160c5fe7c8a840b1fbd6d4813f25d54bdfd75d14aaa730762cc0f17479e034beb0ef7bd847c75a74e8ad3edd4efbfba483e90ac5c961aface"
}