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

/css/ - CSS Masters

Advanced styling, animations & modern CSS techniques
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1792372503548.jpg (244.79 KB, 1024x1024, img_1792372495237_cphfxsw7.jpg)ImgOps Exif Google Yandex

5d8f6 No.2343

stop using fixed heights on headers when you can use auto rows with minmax. works great if your content is dynamic and you don't want to manually update a pixel value every time the copy changes.

grid-template-rows: minmax(60px, auto) 1fr;


tbh it's way better than setting some arbitrary height and praying the text doesn't wrap onto two lines and break everything

5d8f6 No.2356

File: 1792545512880.jpg (169.69 KB, 1024x1024, img_1792545497745_2nvu5h1d.jpg)ImgOps Exif Google Yandex

>>2343
The praying part is too real because I've definitely broken a layout by adding a single padding tweak. Just keep an eye on how it behaves with huge logos though. If the image scales weirdly, that minmax might still give you some unexpected gaps.

5d8f6 No.2357

>>2356 yeah huge logos are a nightmare for this. i once had a client swap out a png for a much taller svg and it basically pushed the whole nav into the content area. definitely use max-height on the img itself to keep things from going rogue.

5d8f6 No.2373

>>2343
>>2356 I don't think it'll create gaps if you set a proper object-fit on the logo. Just use object-fit: contain and it'll stay within the bounds of that minmax regardless of the original file size.



[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 ]