为什么我设置了thead和tfoot的高没有用

来源:3-2 项目作业

慕慕3128940

2019-10-15 01:04:54

*{margin: 0;padding: 0;border: none;}
/* 头 */
.container{width: 100%;}
.container>thead{height: 60px;background:#87cefa;}
.container>thead>tr{overflow: hidden;}
.container>thead>tr>td{float: left;}
/* 尾 */
.container>tfoot{height: 60px;background: #87cefa;}


写回答

2回答

好帮手慕码

2019-10-15

同学你好!
不建议给thead、tfoot设置高度,浏览器不解析的,建议给它下面的tr设置:

http://img.mukewang.com/climg/5da521660940967605690143.jpg

效果:

http://img.mukewang.com/climg/5da5217e09d5f36404570155.jpg

如果帮助到了你,欢迎采纳,祝学习愉快~

0

慕慕3128940

提问者

2019-10-15

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=ta, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
<style>
*{margin: 0;padding: 0;border: none;}
/* 头 */
.container{width: 100%;}
.container>thead{height: 60px;background:#87cefa;}
.container>thead>tr{overflow: hidden;}
.container>thead>tr>td{float: left;}
/* 尾 */
.container>tfoot{height: 60px;background: #87cefa;}
</style>
</head>
<body>
    <table class="container">
        <thead>
          <tr><td><img src="img/logo.png" alt="mook"> </td></tr> 
        </thead>
        <tbody>
           <tr><td>

           </td></tr>
        </tbody>
        <tfoot>
           <tr><td>2019-9-21 &copy;imooc.com</td></tr> 
        </tfoot>
    </table>
</body>
</html>


0

0 学习 · 40143 问题

查看课程