Forum Moderators: open
If I figured out a way to essentially (I'm no PHP expert so I might need some help with this) make URL's like this:...
a {
word-wrap: break-word;
}
For legacy reasons, UAs may also accept ‘word-wrap’ as an alternate name for the ‘overflow-wrap’ property. However this syntax not valid.
An unbreakable "word" may be broken at an arbitrary point if there are no otherwise-acceptable break points in the line. Shaping characters are still shaped as if the word were not broken, and grapheme clusters must together stay as one unit.
word-break:break-all; - only problem is it doesn't work in Firefox or Opera. if I were to hypothetically use a URL shortener it would take away alot of usability from my site
as well it wouldn't fix the same issue when posting extremely long words or phrases.
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<style type="text/css">
#container {
border: 1px solid red;
width: 300px; /* Apply a constrained width */
}
img {
float: left;
width: 100px; /* This has to match the sidebar div left margin */
height: 250px;
}
.imgSidebar div {
margin-left: 100px; /* This has to be at least the img width */
}
a {
word-break: break-all;
}
</style>
</head>
<body>
<div id="container">
<img src="foo.png">
<div class="imgSidebar">
<div>
Text here. Text here. Text here.
Text here. Text here. Text here.
Text here. Text here. Text here.
Text here. Text here. Text here.
Text here. Text here. Text here.
Text here. Text here. Text here.
Text here. etc...
</div>
<div>
<a href="#">http://www.THIS_IS_NOT_BELOW_THE_IMAGE.example.com</a>
</div>
</div>
</div>
</body>
</html>
You're looking for word-break:break-all; - only problem is it doesn't work in Firefox or Opera.
word-wrap: break-word;(although not strictly standards compliant) as Fotiman suggested initially? Doesn't this do the same thing (at least in this instance) and provide cross-browser support, including IE6+? Or am I missing something, what is the real difference between these properties?