找到能避免HTML中多个空格被IE吃掉,变成一个空格的处理办法,就是利用white-space的样式中定义pre。要求IE6以上,并且HTML的要先声明<!DOCTYPE 。对P元素有效,但在select中一试,却无效。失望。


.sel
{width:400px;
 font-family
:宋体;
 white-space
:pre;
}
</style>
<body>
<class="sel">
a
&nbsp;&nbsp;&nbsp;&nbsp;b    c
</p>
<select multiple class="sel">
<option>a&nbsp;&nbsp;&nbsp;&nbsp;b    c</option>
<option>1234567890</option>
</select>
</body>
</html>

相关文章:

  • 2021-12-19
  • 2021-05-26
  • 2022-01-22
  • 2021-12-12
  • 2022-12-23
  • 2021-04-14
  • 2021-08-02
  • 2021-10-17
猜你喜欢
  • 2021-04-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
相关资源
相似解决方案