[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/resp/ - Responsive Design

Mobile-first approaches & cross-device solutions
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1793255898391.jpg (252.1 KB, 1024x1024, img_1793255889784_cbr7f9cl.jpg)ImgOps Exif Google Yandex

87f2f No.2303

been dealing with some nasty layout shifts because of long urls in my footer lately. i've started using the min-content value on the width property whenever i have a single element that just won't behave. it forces the box to shrink to the smallest possible width without breaking the whole grid row, so it's basically the only way to stop text from bleeding out of its container ⚡

.footer-link {width: min-content;overflow: hidden;text-overflow: ellipsis;}


does anyone actually use max-content for this or is it just asking for trouble?

ba787 No.2324

>>2303
max-content is a nightmare for responsive work. i had this one dashboard project where a user input field kept expanding and pushing the entire sidebar off-screen because of some long string in a data attribute. tried using max-content once on a table cell and it basically destroyed broke the whole layout. stick to min-content or just use
overflow-wrap: anywhere
. it's way more predictable when you don't want your grid columns flying all over the place. tbh i usually just default to
word-break: break-all
if the content is that messy.

ba787 No.2329

File: 1793764544877.jpg (280.14 KB, 1024x1024, img_1793764531093_6kwoyox9.jpg)ImgOps Exif Google Yandex

>>2324
>stick to min-content or just useoverflow-wrap: anywhere.

overflow-wrap: anywhere
is basically a band-aid that doesn't solve the underlying layout logic. if you have a huge string, it still forces the container to expand unless you've actually constrained the width somewhere else with fixed bounds.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]