日期:2014-05-17  浏览次数:20798 次

css控制溢出文字替换为点符号显示

??

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <style type="text/css">
	/* IE下的样式 */ 
	p span{
		display: block;
		width:250px;	/*对宽度的定义,根据情况修改*/
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;	/*可选值:clip:不现实溢出文字;ellipsis:将溢出文字用'...'省略显示*/
	}
	/* FF 下的样式 */ 
	p{clear:both;}
	p span{
		float:left;
		max-width:175px;   /*IE不能解释该属性,而FF可以*/
	}
	p:after{
		content:"...";
	}
  </style>
 </HEAD>

 <BODY>
	<div>
		<p>
		<span>
			http://383533005.iteye.com/http://383533005.iteye.com/http://383533005.iteye.com/http://383533005.iteye.com/http://383533005.iteye.com/
		</span>
		</p>
	</div>
 </BODY>
</HTML>

?

?

?

效果图:??????