zoukankan      html  css  js  c++  java
  • Layout-2相关代码:3列布局代码演化[一]

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <style type="text/css">
    .right,.left{height:300px;200px;}
    .right{ float:right;background:#000000;}
    .left{ float:left;background:#009933;}
    .main{background:#F60; height:300px;}
    </style>
    </head>
    <body>
    <div class="right">RIGHT</div>
    <div class="left">LEFT</div>
    <div class="main">MAIN</div>    
    </body>
    </html>
    

     代码演化2:

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <style type="text/css">
    .right, .left {
    	height: 300px;
    	 200px;
    }
    .right {
    	float: right;
    	background: #000000;
    	margin-right:10%;
    }
    .left {
    	float: left;
    	background: #009933;
    	margin-left:10%;
    }
    .main {
    	background: #F60;
    	height: 300px;
    	margin:0 10%;
    }
    </style>
    </head>
    <body>
      <div class="right">RIGHT</div>
      <div class="left">LEFT</div>
      <div class="main">MAIN</div>
    </body>
    </html>
    

     代码演化3:

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <style type="text/css">
    #outbox {
    	 80%;
    	margin-right: auto;
    	margin-left: auto;
    	min-500px;
    }
    .right, .left {
    	height: 300px;
    	 200px;
    }
    .right {
    	float: right;
    	background: #000000;
    }
    .left {
    	float: left;
    	background: #009933;
    }
    .main {
    	background: #F60;
    	height: 300px;
    }
    
    </style>
    </head>
    <body>
    <div id="outbox">
      <div class="right">RIGHT</div>
      <div class="left">LEFT</div>
      <div class="main">MAIN</div>
    </div>
    </body>
    </html>
    

     代码演化4:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Layout</title>
    <style type="text/css">
    * {
    	margin: 0;
    	padding: 0;
    }
    body {
    	position: relative;
    }
    .right, .left {
    	height: 300px;
    	 200px;
    	z-index: 2;
    }
    .right {
    	position: absolute;
    	right: 0;
    	top: 0;
    	background: #000000;
    }
    .left {
    	position: absolute;
    	left: 0;
    	top: 0;
    	background: #009933;
    }
    .main {
    	margin-right: 200px;
    	background: #F60;
    	height: 300px;
    	margin-left: 200px;
    }
    </style>
    </head>
    <body>
    <div class="main">main</div>
    <div class="left">LEFT</div>
    <div class="right">RIGHT</div>
    </body>
    </html>
    

    回答问题:

    请分别说出上面的这种布局的主要特点.

  • 相关阅读:
    nginx 命令 以及普通搭建图片服务
    安卓开发自定义View流程
    01-flask虚拟环境
    vscode切换虚拟环境报错无法加载文件 E:Python_projectshop_envScriptsActivate.ps1,因为在此系统上禁止运行 脚本。
    01-flask旅行网系统功能设计
    10-Python文件操作
    09-Python异常
    08-Python面对对象进阶
    06-Python元组,列表,字典,集合数据结构
    05-Python模块
  • 原文地址:https://www.cnblogs.com/exesoft/p/10637860.html
Copyright © 2011-2022 走看看