首页 > 其他 > 详细

盒子尺寸父子传递及嵌套Demo

时间:2019-04-13 10:15:20      阅读:191      评论:0      收藏:0      [点我收藏+]
 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
 5 <title>无标题文档</title>
 6 <style type="text/css">
 7 <!--
 8 html,body{
 9 height:100%;
10 }
11 .box1 {
12     background-color: #0000FF;
13     height:100%;
14     position:relative;
15 }
16 .box2 {
17     background-color: #00FFFF;
18     height:90%;
19     width:90%;
20     left:5%;
21     top:5%;
22     position:absolute;
23 }
24 .box3 {
25     background-color: #FFFF00;
26     height:20%;
27     width:20%;
28     right:5%;
29     bottom:5%;
30     position:absolute;
31 }
32 -->
33 </style>
34 </head>
35 <body>
36 <div class="box1">
37   <div class="box2">
38     <div class="box3"></div>
39   </div>
40 </div>
41 </body>
42 </html>

 

盒子尺寸父子传递及嵌套Demo

原文:https://www.cnblogs.com/exesoft/p/10699800.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!