Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 尝试仅显示未包装的文本_Css - Fatal编程技术网

Css 尝试仅显示未包装的文本

Css 尝试仅显示未包装的文本,css,Css,我有一个图像和一些文本,它位于图像中。我的问题是,由于显示了我想要的长度,所以当文本被包装时 .temp-image .list .list.caption { background-image:url(bar.png); font-size: 16px; font-weight: bold; height: 30px; left: 1px; line-height: 16px; overflow: hidden; text-align: center;

我有一个图像和一些文本,它位于图像中。我的问题是,由于显示了我想要的长度,所以当文本被包装时

.temp-image .list .list.caption {  
  background-image:url(bar.png);
  font-size: 16px;
  font-weight: bold;
  height: 30px;
  left: 1px;
  line-height: 16px;
  overflow: hidden;
  text-align: center;
  top: 190px;
  width: 256px;
  }

空白:nowrap
添加到css

.temp-image .list .list.caption {  
  background-image:url(bar.png);
  font-size: 16px;
  font-weight: bold;
  height: 30px;
  left: 1px;
  line-height: 16px;
  overflow: hidden;
  text-align: center;
  top: 190px;
  width: 256px;
  white-space: nowrap; /* Prevents Wrapping */
  }

@想要学习谢谢,我知道有一个破折号在那里的某个地方,我把它放在nowrap原来。