开发者

no line break in a long html link?

I know, nobr tag is deprecated, then how开发者_如何学Python can i do this with other tag or css?


use the following css property: white-space:nowrap;


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜