idv+css横向布局绝对定位

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>绝对定位css布局实例</title>
  7. <style>
  8. body
  9. {
  10.   margin:0;
  11. }
  12. #header
  13. {
  14.   position:absolute;
  15.   top:2px;
  16.   left:5px;
  17.   height:80px;
  18.   width:780px;
  19. }
  20. #nav
  21. {
  22.   position:absolute;
  23.   top:87px;
  24.   left:5px;
  25.   height:400px;
  26.   width:180px;
  27. }
  28. #content
  29. {
  30.   position:absolute;
  31.   top:87px;
  32.   left:195px;
  33.   height:400px;
  34.   width:590px;
  35. }
  36. #footer
  37. {
  38.   position:absolute;
  39.   top:492px;
  40.   left:5px;
  41.   height:80px;
  42.   width:780px;
  43. }
  44. div
  45. {
  46.   border:2px solid #000000;
  47. }
  48. </style>
  49. </head>
  50. <body>
  51.   <div id="header">header部分</div>
  52.   <div id="nav">绝对定位的nav部分</div>
  53.   <div id="content">绝对定位的内容部分</div>
  54.   <div id="footer">footer部分</div>
  55. </body>
  56. </html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

百事洞明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值