margin+absolute布局:右栏固定主内容自适应 demo

头部
Main
主内容区域
底部

#demo{width:80%;margin:auto;height:300px;}
#hd2,#ft2{height:50px;background-color:#aaa;}
#bd2{position:relative;margin:10px 0;}
#aside2{position:absolute;top:0;right:0;width:200px;background:#ccc;}
#main2{margin-right:210px;background-color:#aaa;}

#hd3,#ft3{height:50px;background-color:#aaa;}
#bd3{position:relative;margin:10px 0;}
#aside3{position:absolute;top:0;left:0;width:200px;background:#ccc;}
#main3{margin-left:210px;background-color:#aaa;}

#hd4,#ft4{height:50px;background-color:#aaa;}
#bd4{zoom:1;overflow:hidden;margin:10px 0;}
#aside4{float:left;width:200px;background:#ccc;}
#main4{margin-left:210px;background-color:#aaa;}

#bd5{
padding-left:210px;
}
#aside5{
float:left;
position:relative;
left:-210px;
width:200px;
margin-left:-100%;
background:red;
}
#main5{
float:left;
width:100%;
background:pink;
}
#hd5,#ft5{height:50px;background-color:#aaa;}

#hd6,#ft6{height:50px;background-color:#aaa;}
#bd6{zoom:1;overflow:hidden;margin:10px 0;padding-right:210px;}
#aside6{float:left;position:relative;right:-210px;width:200px;margin-left:-200px;background-color:#ccc;}
#main6{float:left;width:100%;background-color:#aaa;}

margin+absolute布局:左栏固定主内容自适应 demo

头部
Main
主内容区域
底部

margin+float布局:左栏固定主内容自适应 demo

头部
Main
主内容区域
底部

float + 负margin 方式

头部
主内容栏自适应宽度
底部

圣杯布局之左栏固定主内容自适应

头部
主内容栏自适应宽度
底部

margin+absolute布局:右栏固定主内容自适应 demo的更多相关文章

  1. CSS 实现:两栏布局(一边固定,一边自适应)

    ☊[实现要求]:CSS实现左边固定,右边自适应父容器宽度的两栏布局. <body> <div class="left"></div> <d ...

  2. css 关于两栏布局,左边固定,右边自适应

    好几个星期都没写博客了,最近不忙也不闲,稀里糊涂过了两个星期,之前几个月内天天坚持签到.最近也没签到.哈哈,说正事. 今天做东钿互金平台后台页面,昨天做了一个登录页面,业偶碰到了一个难题.等下也要把它 ...

  3. css布局--两列布局,左侧固定,右侧自适应(其中左侧要可以拖动,右侧水平滚动条)

    (css布局所要实现的效果) 在前端面试中经常会被问到CSS布局,两列布局,左侧固定,右侧自适应.前几天去面试,遇到了这道题的升级版,要求左侧可拖动,右侧要有水平滚动条.拿到题目确实有些大脑短路,不知 ...

  4. css实现三栏自适应布局(两边固定,中间自适应)以及优缺点

    方法一:绝对定位(absolute + margin) 原理:给左右两边的元素设置absolute,这样左右两边的元素脱离标准文档流的控制,中间的元素自然会上来,然后给中间的元素设置margin留出左 ...

  5. 网页html结构右侧栏固定,左侧自适应大小。

    最近写了一个项目,写页面的结构,html树形结构是有header,container,footer部分,其中container部分是右侧栏是固定宽度,左侧是自适应宽度与屏幕高度. 第一次写的博客文章是 ...

  6. css布局------左右宽度固定,中间宽度自适应容器

    HTML /*适用方法1,方法2*/<body> <div class="container"> <div class="left" ...

  7. css布局------上下高度固定,中间高度自适应容器

    HTML <body> <div class="container"> <div class="header"></d ...

  8. css左右布局,左侧固定,右侧自适应

    实现布局的几种方法,见代码: <!DOCTYPE html> <html lang="cn"> <head> <meta charset= ...

  9. css布局之头尾固定中间高度自适应

    被这个问题困扰了很久.大神别鄙视我,我是搞后台开发的....试过了很多方法,比如设定高度100%.同事用的js计算高度,我对js设置的方式一直觉得不够好,尽管设置高度为100%的方式更差,直到发现了一 ...

随机推荐

  1. 《DSP using MATLAB》示例Example7.4

    代码: h = [-4, 1, -1, -2, 5, 6, 5, -2, -1, 1, -4]; M = length(h); n = 0:M-1; [Hr, w, a, L] = Hr_Type1( ...

  2. wpf Tree

    code using System; using System.Collections.Generic; using System.Linq; using System.Text; using Sys ...

  3. python 读取 xlsx

    >>> xl = pd.ExcelFile("dummydata.xlsx") >>> xl.sheet_names [u'Sheet1', u ...

  4. Mysql 5.7初始化密码

    一.MAC Mysql安装 1.下载dmg安装 从http://dev.mysql.com/downloads/mysql/下载dmg安装 二.Mysql密码修改 1.通过mysql -uroot - ...

  5. 使用dnSpy对目标程序(EXE或DLL)进行反编译修改并编译运行

    本文为原创文章.源代码为原创代码,如转载/复制,请在网页/代码处明显位置标明原文名称.作者及网址,谢谢! 本文使用的工具下载地址为: https://github.com/cnxy/dnSpy/arc ...

  6. MEF学习总结(2)---Primitive层

    Primitive层是属于依赖注入的通用模型,主要有如下核心类型: 1. ComposablePart是核心类,他表示组件容器中的每一个组件,是对真正组件实例的包装.ExportDefinition属 ...

  7. Ubuntu 16.04 配置安卓5.1编译环境

    Ubuntu 16.04版本 电脑cpu必须是64位 硬盘分配大约100G的空间 1.ubuntu中更新源 $ sudo apt-get update 2.安装 openjdk-8-jdk $ sud ...

  8. GPS数据包格式解析

    四种定位系统:1.美国的全球定位系统(Global Positioning System,GPS)2.俄罗斯的格罗拉斯(Global Nabigation Satellite System,GLONA ...

  9. golang的https服务器

    先生成ssl证书 openssl genrsa - openssl req - 然后,大概这样 package main import ( "log" "net/http ...

  10. golang的sync包例子

    package main import ( "fmt" "sync" ) var wg sync.WaitGroup func asyncTestFunc() ...