Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Responsive solution for long URLs (that exceed the device width)

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.

like image 695
emersonthis Avatar asked Aug 10 '13 00:08

emersonthis


People also ask

What is the best way to make your website responsive with zoom in out support?

Use the CSS zoom property to make responsive web development easier. Responsive web development is basically a requirement in 2020.

On which device can responsive Web design be used?

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!

What makes a web page responsive?

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.


1 Answers

If neither hiding or scrolling overflow work for you, consider forcefully word wrapping in CSS:

word-wrap: break-word;
like image 71
Dolph Avatar answered Sep 20 '22 12:09

Dolph