HTML中显示的文字自动换行
生活随笔
收集整理的這篇文章主要介紹了
HTML中显示的文字自动换行
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在html中控制自動換行
http://www.cnblogs.com/zjxbetter/articles/1323449.html
eg:
<table> <tr> <td width="200" style="word-break:break-all;">asdfsasdfasd擴大發射點法打發深刻發射點激發的發覺山地飛機啊飛機萊塞解放龍卷風啊fasasdfsasdfasdfasasdfsasdfasdfasasdfsasdfasdfasasdfsasdfasdfasasdfsasdfasdfasasdfsasdfasdfas</td> </tr> </table>html中td自動換行
head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>無標題文檔</title> <style type="text/css"> table{border-collapse: collapse;border: 1px black solid; }tr td{border: 1px black solid;height: 20px;text-align:center; }</style> </head> <body> <table width="500" rules="all" style="table-layout:fixed"><tr><td width="200px" rowspan="2" style="word-wrap : break-word ">內容內容 內容內容 內容內容 內容內容 內容內容</td><td> </td></tr><tr><td> </td></tr><tr><td> </td><td> </td></tr><tr><td> </td><td> </td></tr> </table> </body> </html> View Code?效果圖
?
關于Asp.Net label的強制換行
第一種方法是直接引用樣式: <style type="text/css">.label{word-wrap:break-word;word-break:keep-all;overflow:hidden;} </style> <asp:Label ID="Label3" runat="server" Width="350px" Text='<%# Bind("y_question") %>' CssClass="label"></asp:Label> 復制代碼 第二種方法:查看頁面源碼發現,解析后的label標簽為<span>所以在頁面添加樣式:<style type="text/css"> span{word-break:break-all;}</style><asp:Label ID="Label3" runat="server" Width="350px" Text='<%# Bind("y_question") %>' ></asp:Label> View Code?
總結
以上是生活随笔為你收集整理的HTML中显示的文字自动换行的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 珊瑚粉、荧光黄、浪潮蓝,Beats Fi
- 下一篇: 2020CF7月枪王自助餐活动入口 CF