用CSS樣式固定表格寬度

來源:互聯網
上載者:User
css

  在table或div裡顯示文章的時候,如果是漢字,文章會根據table和div的width屬性自動分行,但如果是英文,當單詞長度超過table或div寬度的時候,table/div便會被撐開,有時候會造成頁面很難看,這時可以給table/div設定如下樣式:

word-break:break-all;word-wrap:break-word;

  單詞超長的時候能夠自動截斷單詞分行,避免上述情況的發生。



相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.