• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
保卫萝卜
博客园    首页    新随笔    联系   管理    订阅  订阅
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

 

posted on 2016-08-29 12:55  保卫萝卜  阅读(512)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3