Created
January 28, 2014 11:36
-
-
Save apphp/8666173 to your computer and use it in GitHub Desktop.
Prevent Long URL's From Breaking Out with CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This solution will help you to prevent many issues with your site, when you need to prevent long URL's from breaking out of container. | |
Source: http://www.apphp.com/index.php?snippet=css-breaking-out-long-urls | |
*/ | |
<style type="text/css"> | |
.break { | |
-ms-word-break: break-all; | |
word-break: break-all; | |
word-break: break-word; | |
-webkit-hyphens: auto; | |
-moz-hyphens: auto; | |
hyphens: auto; | |
} | |
.ellipsis { | |
width: 250px; | |
white-space: nowrap; | |
overflow: hidden; | |
-ms-text-overflow: ellipsis; /* Required for IE8 */ | |
-o-text-overflow: ellipsis; /* Required for Opera */ | |
text-overflow: ellipsis; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment