开发者

CSS Text always across the same line

I have a system similar to BB code whereby text within two tags is converted into a link which when hovered over produces an line image.

The problem is that sometimes if the phrase is long the text wraps onto the next line. When this occur the image is displayed above the text on the preceeding line and doesn't look right. Bec开发者_开发技巧ause of this I want to ensure that if the text is going to wrap, it instead breaks to a new line.

I'm happy with any CSS3 only solutions to this.

Thanks


give your a css display: inline-block. Inline block doesn't allow breaking within the block and therefore moves to the next line.

a {
 display: inline-block;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜