zoukankan      html  css  js  c++  java
  • CSS布局

    <!DOCTYPE html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8">
    	<title>圣杯布局</title>
    	<style type="text/css">
    		* {
    			margin: 0px;
    			padding: 0px;
    		}
    		.container {
    			padding: 0px 200px;
    			height: 200px;
    			background: #eee;
    			min- 400px;
    
    		}
    		.left ,.right {
    			 200px;
    			height: 200px;
    			background: red;
    			float: left;
    		}
    		.main {
    
    			 100%;
    			height: 200px;
    			background: blue;
    			float: left;
    		}
    		.left {
    			margin-left: -100%;
    			position: relative;
    			left:-200px;
    		}
    		.right {
    			margin-left: -200px;
    			position: relative;
    			right: -200px;
    		}
    	</style>
    </head>
    <body>
    	<div class="container">
    		<div class="main">中间</div>
    		<div class="left">左边</div>
    		<div class="right">右边</div>
    	</div>
    </body>
    </html>
    
    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>shuipingchuzhijuzhong</title> <style type="text/css"> * { margin: 0px; padding: 0px; } .box { position: relative;  200px; height: 200px; background: lightgreen; } .out { position: absolute; left: 50%; top: 50%; } .in { background: red; margin-top: -50%; margin-left: -50%; } </style> </head> <body> <div class="box"> <div class="out"> <div class="in">内容</div> </div> </div> </body> </html>
  • 相关阅读:
    网页游戏中PK系统的实现
    操作系统面试题
    9.26<立方网>技术笔试题
    cocos2d-x游戏之2048
    适配器模式
    工厂模式的三种形式
    面向对象设计的几大原则
    数据库的优化
    @RequestBody的使用
    vue.js小记
  • 原文地址:https://www.cnblogs.com/tasly/p/11831296.html
Copyright © 2011-2022 走看看