div {
width:100px;
height:200px;
word-wrap: break-word;
overflow:hidden;
}

这个可以固定div的宽高,溢出内容会被剪除。

table{
table-layout:fixed;
width:200px;
height:200px;
 }
td {
width:100px;
height:200px;
overflow:hidden;
}

这个只能固定td的宽度,而高度随内容增加而增高;若也要固定其高度,则需要在td中嵌套使用div,包住content,利用div的css。

如果 去除 table-layout:fixed; 情况则会反过来。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2021-11-07
  • 2021-05-26
猜你喜欢
  • 2021-11-29
  • 2022-03-06
  • 2021-08-15
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案