欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

淺析CSS3 用text-overflow解決文字排版問題

  發(fā)布時間:2020-10-28 15:50:30   作者:Blank0411   我要評論
這篇文章主要介紹了CSS3 用text-overflow解決文字排版問題,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友參考下吧

基本語法
text-overflow的使用需配合hight,over-flow:hidden;white-space:nowrap;三個屬性共同使用

text-overflow: clip;ellipsis;string
clip: 直接隱藏不顯示
ellipse: 用… 三個點來表示溢出的文字 (常用)
string:可自定義符號來表示放不下的字符

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<style type="text/css">
		.tf{
			width: 100px;
			height:50px;
			border:1px solid black;
			overflow: hidden;
			text-overflow: clip;/*如果只是單純的隱藏的話,加不加這句話效果都一樣  height+overflow就可對溢出的文字直接隱藏*/
		}
		.tf1{
			width: 100px;
			border:1px solid black;
			overflow: hidden;
			text-overflow: ellipsis;
			-webkit-text-overflow: ellipsis;
			white-space: nowrap;
			/*若使用ellipsis屬性     
				text-overflow:ellipsis; overflow: hidden;white-space: nowrap;
			 這三個屬性缺一不可
			*/
		}
	</style>
</head>
<body>
	<div class="tf">
		腳本之家腳本之家腳本之家腳本之家腳本之家腳本之家腳本之家腳本之家腳本之家。
	</div>

	<div class="tf1">
		腳本之家腳本之家腳本之家腳本之家腳本之家腳本之家。
	</div>

	
</body>
</html>

到此這篇關于淺析CSS3 用text-overflow解決文字排版問題的文章就介紹到這了,更多相關CSS3 文字排版內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持腳本之家!

相關文章

最新評論