开发者社区> 问答> 正文

display:table 单元格变形问题

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
    .container {
        display: table;
        border-spacing: 4px;
        table-layout: fixed;
        width: 150px;
    }
    .row {
        display: table-row;
    }
    .cell{
        background: red;
        width: 150px;
        height:150px;
        display: table-cell;
    }
</style>
<title></title>
</head>
<body>
<div class="container">
<div class="row">
    <div class="cell">55555555555555555555555555555555</div>
    <div class="cell"></div>
</div>
<div class="row">
    <div class="cell"></div>
    <div class="cell"></div>
</div>
</div>
</body>
</html>

请先看显示效果
screenshot

展开
收起
a123456678 2016-03-26 15:00:37 2327 0
1 条回答
写回答
取消 提交回答
  • .row {
        display: table-row;
        height:150px;
    }
    .cell{
        background: red;
        width: 150px;
        display: table-cell;
    }
    2019-07-17 19:16:15
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载