<!DOCTYPE html>
<html lang="zh-CN"> <head> <meta charset="utf-8">
<title>position</title>
<style>
html,
body {
height: 100%;
width: 100%;
margin: 0 auto;
padding: 0;
text-align: center;
} .container {
position: relative;
width: 100%;
height: 100%;
background: #FFF0F5;
} .header {
width: 100%;
height: 100px;
line-height: 100px;
position: absolute;
background-color: #FFDAB9;
} .footer {
width: 100%;
height: 100px;
line-height: 100px;
position: absolute;
bottom: 0px;
background-color: #FFFACD;
} .left {
top: 100px;
bottom: 100px;
background-color: #20B2AA;
width: 100px;
position: absolute;
overflow: auto;
} .middle {
top: 100px;
left: 100px;
bottom: 100px;
right: 200px;
background-color: #F0E68C;
position: absolute;
overflow: auto;
} .right {
top: 100px;
right: 0px;
background-color: #708090;
overflow: auto;
position: absolute;
bottom: 100px;
width: 200px;
}
</style>
</head> <body>
<div class="container">
<div class="header">这是顶部</div>
<div class="left" id="left_content">
<script>
for (var i = 1; i <= 500; i++) {
document.getElementById("left_content").innerHTML = document.getElementById("left_content").innerHTML + i.toString() + "<br/>";
}
</script>
</div>
<div class="middle" id="middle_content">
<script>
for (var i = 1; i <= 500; i++) {
document.getElementById("middle_content").innerHTML = document.getElementById("middle_content").innerHTML + (i * 10).toString() + "<br/>";
}
</script>
</div>
<div class="right" id="right_content">
<script>
for (var i = 1; i <= 500; i++) {
document.getElementById("right_content").innerHTML = document.getElementById("right_content").innerHTML + (i * 100).toString() + "<br/>";
}
</script>
</div>
<div class="footer">这是底部</div>
</div> </body> </html>

  

css Position 上下左中右布局的更多相关文章

  1. android RelativeLayout实现左中右布局

    RelativeLayout实现左中右布局   <RelativeLayout android:layout_width="match_parent" android:lay ...

  2. CSS左中右布局,规范案例

    html部分 <body> <form id="form1" runat="server"> <div id="wrap ...

  3. RelativeLayout实现左中右布局

    <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_co ...

  4. 典型的DIV+CSS布局——左中右版式

    [效果] [HTML] <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Def ...

  5. css-前端实现左中右三栏布局的常用方法:绝对定位,圣杯,双飞翼,flex,table-cell,网格布局等

    1.前言 作为一个前端开发人员,工作学习中经常会遇到快速构建网页布局的情况,这篇我整理了一下我知道的一些方法.我也是第一次总结,包括圣杯布局,双飞翼布局,table-cell布局都是第一次听说,可能会 ...

  6. CSS使用position:sticky 实现粘性布局

    简介 前面写了一篇文章讲解了position常用的几个属性:<CSS 属性之 position讲解>一般都知道下面几个常用的: { position: static; position: ...

  7. 记一道css面试题 : 三栏布局两边宽度固定,中间宽度自适应,并且布局随屏幕大小改变。

    前几天面试时有道css题没做出来,回来好好学习一番后把其记录下来. 题目是这样的:左中右三栏布局,左右两栏宽度固定,左右两栏的宽度为200像素,中间栏宽度自适应.当屏幕小于600px时,3栏会分别占用 ...

  8. CSS系列,三栏布局的四种方法

    三栏布局.两栏布局都是我们在平时项目里经常使用的,今天我们来玩一下三栏布局的四种写法,以及它的使用场景. 所谓三栏布局就是指页面分为左中右三部分然后对中间一部分做自适应的一种布局方式. 1.绝对定位法 ...

  9. CSS position绝对定位absolute relative

    常常使用position用于层的绝对定位,比如我们让一个层位于一个层内具体什么位置,为即可使用position:absolute和position:relative实现. 一.position语法与结 ...

随机推荐

  1. final关键字与类型转换

    一.关于final的重要知识点; 1.final关键字可以用于成员变量.本地变量.方法以及类. 2. final成员变量必须在声明的时候初始化或者在构造器中初始化,否则就会报编译错误. 3. 你不能够 ...

  2. [原创]新版PageOffice V4.0为什么用弹出窗口的方式打开文件?

    前的包含文档处理功能的Web办公系统,在打开文档的时候,一部分系统是采用Office文档嵌入到主窗口页面中右侧工作区域的方式,另一部分系统采用的是弹出新的浏览器窗口,里面完整的嵌入Office文件的打 ...

  3. Delphi XE10百集视频教程计划

    1. 前言 本人现在的职业是Java程序员,一直想学习一个做桌面应用的编程语言,几年前无意中接触到Delphi,比VB功能强大,比C++语法更容易理解,加上Oracle的PL/SQL的底子,最终决定学 ...

  4. C#计算两个时间的时间差,精确到年月日时分秒

    喏,计算两个时间的时间差,精确到年月日时分秒 看起来比较笨的方法了,不知道有没有改进 DateTime d1 = new DateTime(2016, 4, 1, 0, 0, 0); DateTime ...

  5. 玩转大数据之Apache Pig如何与Apache Lucene集成

     在文章开始之前,我们还是简单来回顾下Pig的的前尘往事: 1,Pig是什么? Pig最早是雅虎公司的一个基于Hadoop的并行处理架构,后来Yahoo将Pig捐献给Apache(一个开源软件的基金组 ...

  6. hive报错( Non-Partition column appears in the partition specification)

    在写及测的过程中发现的,有一些可能需要进一步验证.有时候hive报错位置不一定正确需要多确认 1 FAILED: NullPointerException null 不能用视图作为left outer ...

  7. 1、mysql安装教程

    1.https://www.runoob.com/mysql/mysql-install.html   参考安装链接 Windows 上安装 MySQL Windows 上安装 MySQL 相对来说会 ...

  8. js中的对象、原型链机制、构造函数

    一.在js中创建对象的方式 //一.字面量或直接量创建对象 var obj1 = { name:"zs", age:12 }; //二.通过new来创建对象 var obj2 = ...

  9. utils05_git在idea下的操作

    1.idea下将工程添加到本地仓库 1>找到自己的git.exe 2>创建本地的git仓库,将项目放入本地仓库 3> *从本地仓库更新 *提交到本地仓库 *比较版本差异 *丢弃我的修 ...

  10. QEventLoop配合QTimer实现阻塞任务超时处理

    A阻塞主线程正常运行,需要做特殊处理. 以下代码可实现,A阻塞或者正常处理时,均不阻塞主线程正常处理. QEventLoop eventloop; // use point to manage eve ...