zoukankan      html  css  js  c++  java
  • 慕课笔记利用css进行布局【混合布局】

    <html>
    	<head>
    		<title>混合布局学习</title>
    		<style type="text/css">
    			body{margin:0;padding:0;text-align:center}
    			.top{height:50px;background:#00f;margin:0 auto}
    			.head{height:50px;700px;background:#f96;margin:0 auto}
    			.main{700px;height:600px;background:#ccc;margin:0 auto}
    			.foot{700px;height:50px;background:#0f0;margin:0 auto}
    			/*中间部分布局*/
    				/*float:left向左浮动*/
    			.left{500px;height:600px;background:#f00;float:left}
    			.sub_ll{100px;height:600px;background:#f33;float:left}
    			.sub_lr{400px;height:600px;background:#f66;float:right}
    			.right{200px;height:600px;background:#ff0;float:right}
    		</style>
    	</head>
    	<body>
    	混合布局样式<br/>
    	<div class="top">
    		<div class="head">标题</div>
    	</div>
    	<div class="main">
    		<div class="left">
    			<div class="sub_ll">左侧的子1</div>
    			<div class="sub_lr">左侧的子2</div>
    		</div>
    		<div class="right">我是右侧的内容哦</div>
    	</div>
    	<div class="foot">04</div>
    	 <br/>
    	 <br/>
    
    	</body>
    </html>
    

     效果如下:

    关键知识点:

    通过div的嵌套,利用float对div的布局进行控制,注意子div的宽度之和应该与父div的宽度大小一样

  • 相关阅读:
    QT Launching Debugger 卡住
    VS无法打开源文件"stdio.h"
    QT 5.15 https 无法访问 TLS initialization failed
    .Net 添加第三方控件
    XML解析——DOM解析
    javascript——对象
    SQL Server 合并表 union 和union all
    深入理解HTTP
    HTTP详解(3)-http1.0 和http1.1 区别
    HTTP详解(2)
  • 原文地址:https://www.cnblogs.com/soulsjie/p/7255753.html
Copyright © 2011-2022 走看看