加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – CSS如何使固定高度?

发布时间:2020-12-14 21:42:53 所属栏目:资源 来源:网络整理
导读:table cellspacing="0" id="contactTable" style="table-layout:table-layout:fixed;; width:100%; font-weight:normal; position: absolute; top:45; left: 0;"td height="50" style="padding-left:5px; overflow:hidden; " span style="text-transform:cap
<table  cellspacing="0" id="contactTable" style="table-layout:table-layout:fixed;; width:100%; font-weight:normal; position: absolute; top:45; left: 0;">

<td height="50" style="padding-left:5px; overflow:hidden; ">
    <span style="text-transform:capitalize;line-height:100%;">
    //names here
    </span>                          
    </td>

...more code
</table>

这不行。溢出仍然使得单元格更高,高度是包含内容。

解决方法

最好的解决方案是把一个div放在单元格的高度上:
<td style="padding-left:5px;">
  <div style="height: 50px; overflow:hidden;">
      ...
  </div>
</td>

BTW,什么是跨度?如果您只需要它的样式,您可以直接替换单元格。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读