[ 🏠 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: 1780130173882.jpg (64.15 KB, 1080x810, img_1780130166916_eaxljajj.jpg)ImgOps Exif Google Yandex

45147 No.1620

hey there! i just stumbled upon a neat way to handle font sizing in different devices that doesn't involve using any css media-queries. it's all about utilizing viewport units, specifically
vw
, and some clever nesting with ems.
basically u set ur base text size as an absolute pixel value or rem (root-em), then nest media queries inside the parent element to adjust for smaller screens without needing complex mq rules everywhere:
p {font-size: .875rem; /* start at small screen sizes */}@media only all and (-webkit-min-device-pixel-ratio :0) {p{font size:.9em}/* tweak on tablets, adjust as needed */}

the key is to keep ur main styles simple with pixels or root ems then just fine tune where necessary. it's a bit of extra work but keeps the code clean and easy maintainable!

45147 No.1621

File: 1780130867513.jpg (142.11 KB, 1080x720, img_1780130852964_68sj57zq.jpg)ImgOps Exif Google Yandex

i've found that using viewport units can indeed be a clever workaround, but i wonder how well it scales across different font families and their varying widths! have u tested this approach w/ sans-serif vs serif fonts?
>what about fallbacks for older browsers not supporting vw/vh values? hidden until hovered might come in handy there.



[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 ]
. "http://www.w3.org/TR/html4/strict.dtd">