As the title implies, while building responsive sites, I often run into an issue with long(ish) URLs breaking my fluid grid and causing horizontal scrolling on smaller devices. Because they're one long string, they don't wrap and push the width of their container to wider than the device width...
<--device-->
______________
| |
| http://longurlthatdoesntfit.com
| |
| |
Sometimes I make the container overflow:hidden
but that just chops off the end of the URL and it tends to lock glitchy. Another approach might be to shrink the font-size on smaller devices, but in situations where the URL lengths vary, it would mean shrinking it WAY down to ensure it always has enough space.
There must be a better way.
Use the CSS zoom property to make responsive web development easier. Responsive web development is basically a requirement in 2020.
Responsive web design, also called RWD design, describes a modern web design approach that allows websites and pages to render (or display) on all devices and screen sizes by automatically adapting to the screen, whether it's a desktop, laptop, tablet, smartphone, or even a smart TV!
Responsive Web design is the approach that suggests that design and development should respond to the user's behavior and environment based on screen size, platform and orientation. The practice consists of a mix of flexible grids and layouts, images and an intelligent use of CSS media queries.
If neither hiding or scrolling overflow work for you, consider forcefully word wrapping in CSS:
word-wrap: break-word;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With