html - 在 html 中停止自动换行

标签 html css

我不想自动换行,但这是存在的。我设置的宽度大于文本长度,但这仍然会中断,所以我怎样才能停止断字。

CSS

.menu{
    float:left;
    width:120px;
    height:34px;
    padding:12px 6px 0 6px;
    color:#cc8d50;

}

最佳答案

尝试:

.menu{
    white-space: nowrap;
...

将其添加到您的 CSS。

关于html - 在 html 中停止自动换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3658753/

相关文章:

javascript - 在 mutli div 中选择多个输入

javascript - 一段时间后,我的绘图工具在绘图中留下了空白

html - object-fit 的替代选项 :cover for internet explorer

html - 如何获取 div 标签值并在 css 文件中使用它?

css - 对背景图像的悬停效果

html - 更改 CSS Link Visited Hover 在 html 部分处于事件状态

javascript - 需要追加 div 回到原来的位置

javascript - Ember.js 搜索模型动词

jquery - 使用 JQuery 将 CSS 从一个类复制到另一个类?

javascript - 如何将输入表单中的文本移动到 div