This technique is applicable to Cascading Style Sheet / HTML technologies.
Long URLs can break reflow when the page is zoomed. The objective of this technique is to present URLs without introducing a horizontal scroll bar at a width equivalent to 320 CSS pixels or a vertical scroll bar at a height equivalent to 256 CSS pixels. This is done by using CSS techniques that adapt to the available viewport space. Note: Using a human readable text link, rather than a long URL, is better for usability and accessibility.
By default most browsers will wrap long URLs at the following characters:
Using the following CSS will cause long URLs to break at appropriate places (hyphens, spaces, etc.) and within words without causing reflow.
List of CSS declarations used and why they are used:
a {overflow-wrap: break-word;}
Note: IE and Edge only support this declaration when used with the following declaration.
/* specific for IE10 & 11, they do not support these declarations with "a" selector, must use the * (all elements) selector.*/
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
* { word-wrap: break-word;}
}
/* for all Edge, does not support these declarations with "a" selector, must use the * (all elements) selector. */
@supports (-ms-ime-align:auto) {
* { word-wrap: break-word;}
}
Note: If the browser is not capable of zooming to 400%, you can reduce the width of the browser proportionally. For example, at 300% zoom the viewport should be sized to 960px wide.