css talbe中td溢出隱藏 div溢出隱藏
阿新 • • 發佈:2018-03-27
color 註意 blog tab 作用 部分 不換行 ext you
td溢出隱藏
1 table{ 2 width:100px; 3 table-layout:fixed;/* 只有定義了表格的布局算法為fixed,下面td的定義才能起作用。 */ 4 } 5 td{ 6 width:100%; 7 word-break:keep-all;/* 不換行 */ 8 white-space:nowrap;/* 不換行 */ 9 overflow:hidden;/* 內容超出寬度時隱藏超出部分的內容 */ 10 text-overflow:ellipsis;/* 當對象內文本溢出時顯示省略標記(...) ;需與overflow:hidden;一起使用*/11 }
div溢出隱藏
style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 190px" 註意一定要設置寬度
css talbe中td溢出隱藏 div溢出隱藏