DIV中字數太多破壞原本設定大小的處理方式【overflow】

摘要:DIV中字數太多破壞原本設定大小的處理方式【overflow】

在DIV中秀出資料的時候
如果資料超過我們原本設定的大小
那麼DIV的大小就會被破壞

為了解決這個問題,可以使用style中的overflowtext-overflow來處理
以下是範例與法與結果

 



Effect of CSS property text-overflow

Each box (DIV element) below contains the following text:

We hold these truths to be self-evident, that all people are created equal.

Note how the STYLE settings effect the rendering of the text


STYLE ='text-overflow : clip; overflow : hidden'
We hold these truths to be self-evident, that all people are created equal.


STYLE ='text-overflow : ellipsis; overflow : hidden'
We hold these truths to be self-evident, that all people are created equal.


STYLE ='text-overflow : ellipsis; overflow : visible'
We hold these truths to be self-evident, that all people are created equal.







 



 


以下是簽名:


Microsoft MVP
Visual Studio and Development Technologies
(2005~2019/6) 
topcat
Blog:http://www.dotblogs.com.tw/topcat