html/css 钢琴黑白格布局

效果图:

 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=utf-8" />
 5 <title>无标题文档</title>
 6 <style>
 7 body{margin:0;}
 8 .one{width:100px; height:100px;  float:left;}
 9 .body{ margin:100px 100px 100px 100px;width:300px;height:100px; border:1px solid #000; border-left:0; }
10 .first{width:50px; height:100px; border:1px solid #000; float:left; border-bottom:0;}
11 .firstblack{width:50px; height:60px; border:1px solid #000; background-color:#000;}
12 .secondblack{widtn:50px; height:30px;  border:1px solid #000; background-color:#000; margin-top:-62px;}
13 .two{width:100px; height:100px; overflow:hidden; float:left;}
14 .three{width:100px; height:100px; overflow:hidden; float:left;}
15 
16 </style>
17 </head>
18 
19 <body>
20 <div class="body">
21 <div class="one">
22     <div class="first"></div>
23     <div class="firstblack"></div>
24     
25     <div class="secondblack"></div>
26 </div>
27 
28 <div class="two">
29     <div class="first"></div>
30     <div class="firstblack"></div>
31     
32     <div class="secondblack"></div>
33 </div>
34 <div class="three">
35     <div class="first"></div>
36     <div class="firstblack"></div>
37     
38     <div class="secondblack"></div>
39 </div>
40 </div>
41 
42 </body>
43 </html>
View Code

 

转载于:https://www.cnblogs.com/baoweiluobo/p/5817602.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值