Home > Web Front-end > HTML Tutorial > 关于div中文字不换行的问题_html/css_WEB-ITnose

关于div中文字不换行的问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:47:19
Original
1280 people have browsed it

html,css

html:
内容不换行,宽度相对变化

复选框


css
.labelDiv{
  display: inline-block;
  width:75%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space:nowrap;
}
.iconDiv{
  display: inline-block;
  vertical-align:middle;
  width:25%;
}
大概内容就是这样了,把div中的内容设为不换行实现了,但是.labelDiv的宽度却有了最小的宽度(当缩小的一定时候就不变了,但放大还是可以按比例缩放),如何让其宽度依然按比例缩放呢?新人谢谢解答了

回复讨论(解决方案)

LZ自己不是已经实现了么?

我实现了不换行,但是产生附带的问题了,相对宽度(75%)不能用了,我想问的是这个问题

<div class="labelDiv">内容不换行,宽度相对变化</div><div class="iconDiv">复选框</div><br class="clear" />
Copy after login


.labelDiv{  display: inline-block;  width:75%;  overflow: hidden;  text-overflow: ellipsis;  white-space:nowrap;  float:left;}.iconDiv{  display: inline-block;  vertical-align:middle;  width:25%;  float:right}.clear{clear:both;}
Copy after login

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template