html5 div布局与table布局详解
本文实例为大家解析了html5 div布局与table布局,供大家参考,具体内容如下
div布局:html+css实现简单布局。
#container中height不能写成百分数,必须为具体高度。
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>div布局</title> <style type="text/css"> body{ margin:0; padding:0; } #container{ width:100%; height:650px; background-color: aqua; } #heading{ width:100%; height:10%; background-color: azure; } #content-menu{ width:30%; height:80%; background-color: chartreuse; float:left; } #content-body{ width:70%; height:80%; background-color: chocolate; float:left; } #footer{ width:100%; height:10%; background-color: darkgrey; clear: both; } </style> </head> <body> <div id="container"> <div id="heading">头部</div> <div id="content-menu">内容菜单</div> <div id="content-body">内容主体</div> <div id="footer">底部</div> </div> </body> </html>
效果图:
table布局:
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>table布局</title> </head> <body marginwidth="0px" marginheight="0px"> <table width="100%" height="650px" style="background-color: aqua"> <tr> <td colspan="3" width="100%" height="10%" style="background-color: chartreuse">这是头部</td> </tr> <tr> <td width="20%" height="80%" style="background-color: antiquewhite">左菜单</td> <td width="60%" height="80%" style="background-color: coral">内容</td> <td width="20%" height="80%" style="background-color: cornflowerblue">右菜单</td> </tr> <tr> <td colspan="3" width="100%" height="10%" style="background-color: crimson">这是底部</td> </tr> </table> </body> </html>
效果图:
(资源库 www.zyku.net)
您可能感兴趣的文章
- 04-09jQuery实现鼠标拖动div改变位置、大小的实践
- 05-09一张图解析FastAdmin中的表格列表的功能
- 05-05excel表格中自动生成手机号码
- 04-08div去除点击出现蓝框的方法
- 06-15HTML/CSS:div居中和div内部元素垂直居中
- 05-16jQuery实现div跟随鼠标移动
- 03-17Bootstrap表格制作代码
- 03-16div中文字内容溢出常见的解决方法
- 02-19ecshop商品页面提示Warning: Division by zero in解决
- 02-17bootstrap table 数据表格行内修改的实现代码
- 10-19ipad2021如何快速截屏
- 03-10MySQL创建utf-8格式数据库的方法
- 12-01MySQL root用户被删除的解决方法
- 10-27和家亲监控连接步骤介绍
- 12-13HTML <video> 标签
- 11-08网易云音乐怎么收藏播客
- 09-14荣耀平板V7Pro在哪里开启人脸解锁
- 02-14华为手机钱包设置手势密码教程
- 02-21DedeCMS相关文章调用标签代码
- 10-15荣耀手机如何设置24小时时间
最近更新
阅读排行
猜你喜欢
- 12-27字体大全管家-字体大全管家应用软件功
- 09-17网易云音乐云圈在哪里进入
- 02-20Ubuntu安装字体教程
- 03-03华为手机闹钟设为视频方法
- 01-11拍照计数-拍照计数应用软件功能介绍
- 03-15前端布局神器display:flex
- 12-25刷活-刷活应用软件功能介绍
- 12-16红米note8如何设置性能优先
- 12-31古耐助眠-古耐助眠应用软件功能介绍
- 10-22华为手表如何连接新手机