如何使用CSS防止列表项中的换行符 [英] How to prevent line breaks in list items using CSS

查看:92
本文介绍了如何使用CSS防止列表项中的换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 li 标签在菜单中提供提交简历链接。因为两个词之间的空格,它包装到两行。

I'm trying to put a link called Submit resume in a menu using a li tag. Because of the whitespace between the two words it wraps to two lines. How to prevent this wrapping with CSS?

推荐答案

使用 white-space :nowrap; 通过将 li 的宽度设置为更大的值,给予该链接更多的空间。

Use white-space: nowrap;, or give that link more space by setting li's width to greater values.

这篇关于如何使用CSS防止列表项中的换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆