I know, nobr tag is deprecated, then how can i do this with other tag or css?
-
possible duplicate of How to prevent a line break in a html link?– Ian MackinnonSep 3, 2013 at 10:16
5 Answers
This works applied to the link directly: (tested in Chrome, Safari, Firefox)
a {
word-break:break-all;
}
Try using non-breakable spaces to prevent text from breaking:
You can also define breaking behaviour in CSS:
.nobr { white-space: nowrap; }
if the parent div or whatever doesn't have an explicit width, the link will go on one line for the whole size of the screen...if it's longer than that, consider changing it to
<a href="http://a/long/address/">Link</a>
use this CSS to no line break in a long html link string
display: block;
overflow: hidden;
text-overflow: ellipsis;
width: 200px;