Home  >  Article  >  Web Front-end  >  <div>或<td>中怎么让控件不换行_html/css_WEB-ITnose

<div>或<td>中怎么让控件不换行_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-21 09:02:161515browse

style="white-space:nowrap;word-break:keep-all;"   nowrap="nowrap"


网上说的这些方法也都试过,然并卵。


回复讨论(解决方案)

display:inline或inline-block不好使吗

如果想要不换行,建议使用行内元素
用块级元素在行内展示的话可以设置其display属性为inline或者inline-block,又或者设为float

除了上面两位说的,还要注意父级元素的宽度要大于它里面元素的宽度和

display:inline或inline-block不好使吗

不行

如果想要不换行,建议使用行内元素
用块级元素在行内展示的话可以设置其display属性为inline或者inline-block,又或者设为float

用float成功了,可是为什么white-space:nowrap;这个在我这边不行呢? 是我的问题吗,如果知道希望能回答,谢谢
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn