css布局 -双飞翼布局&圣杯布局
一,双飞翼布局
左右两边固定,中间可以随着浏览器放大和缩小

<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>双飞翼布局</title>
<style>
* {
margin: 0;
padding: 0;
} .main .container {
width: 100%; } .main .container .contain {
background: blue;
margin-left: 200px;
margin-right: 200px;
} .main .left {
width: 200px;
background: pink;
margin-left: -100%;
} .main .right {
width: 200px;
margin-left: -200px;
background: red;
} .main>div {
float: left;
}
</style>
</head> <body>
<div class="main">
<div class="container">
<div class="contain">中间</div>
</div>
<div class="left">左边</div>
<div class="right">右边</div>
</div>
</body> </html>
二,圣杯布局
头部和尾部,左边,右边固定,中间可以随浏览器放大和缩小

<!DOCTYPE html>
<html lang="en"> <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>圣杯布局</title>
<style>
* {
margin: 0;
padding: 0;
} .container {
display: flex;
flex-direction: column;
height: 100vh;
} header {
background: red;
} section {
background: pink;
flex: 1;
display: flex;
} footer {
background: blue;
} .left,
.right {
background: orange;
flex: 0 0 200px;
} .content {
background: olivedrab;
flex: 1;
}
</style>
</head> <body>
<div class="container">
<header>头部</header>
<section>
<div class="left">左边</div>
<div class="content">中间</div>
<div class="right">右边</div>
</section>
<footer>尾部</footer>
</div>
</body> </html>
css布局 -双飞翼布局&圣杯布局的更多相关文章
- css实现三栏水平布局双飞翼与圣杯布局
作为布局的入门级选手,网上也查看了很多信息和资源 双飞翼的html结构 <div class="container"> <div class="main ...
- CSS布局方案之圣杯布局
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...
- CSS之圣杯布局与双飞翼布局
圣杯布局 三行等高 HTML: <!DOCTYPE html><html><head> <meta charset="utf-8"& ...
- CSS 圣杯布局 / 双飞翼布局的实现
工作的越久,有些基础知识我们可能就逐渐淡忘了,今天我们来回顾一下css的圣杯布局和双飞翼布局, 这两个名词你可能不熟, 那三栏布局你肯定就非常熟悉了, 就是两边定宽, 中间自适应 的 布局 1 , 圣 ...
- CSS经典布局——圣杯布局与双飞翼布局
一.圣杯布局和双飞翼布局的目的 实现三栏布局,中间一栏最先加载和渲染 两侧内容固定,中间内容随着宽度自适应 一般用于PC网 二.圣杯布局的实现 技术要点: 设置最小宽度min-width 使用floa ...
- 中间自适应,左右定宽的两种经典布局 ---- 圣杯布局 VS 双飞翼布局
一.引子 最近学了些js框架,小有充实感,又深知如此节奏的前提需得基础扎实,于是回头想将原生CSS和Javascript回顾总结一番,先从CSS起,能集中它的就在基础的布局上,便查阅了相关资料,将布局 ...
- 【布局】圣杯布局&双飞翼布局
背景 随着前端技术的发展推进,web端的布局方式已基本成熟,那么在网站布局方式中,三列布局最为常用,布局方式也有很多,渐渐的开发者们开始从效率的角度优化自己的代码"如果三排布局能将中间的模块 ...
- CSS布局 -- 圣杯布局 & 双飞翼布局
按照我的理解,其实圣杯布局跟双飞翼布局的实现,目的都是左右两栏固定宽度,中间部分自适应. 但在这里实现起来还是有一些区别的 [圣杯布局] 在这里,实现了左(200px) 右(220px) 宽度固定,中 ...
- CSS布局经典—圣杯布局与双飞翼布局
在我之前的博客网页整体布局完全剖析-剖完你不进来看一下么?中总结单列.两列.三列固宽与变宽布局,我还以为已经囊括了所有经典的网页布局方法了呢,当然除了CSS3的弹性盒模型没有涉及到,现在看来确实是自己 ...
- CSS经典布局-圣杯布局、双飞翼布局
圣杯布局的来历是2006年发在a list part上的这篇文章:In Search of the Holy Grail · An A List Apart Article圣杯是西方表达“渴求之物&q ...
随机推荐
- 【剑指Offer面试编程题】题目1504:把数组排成最小的数--九度OJ
题目描述: 输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个.例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323. 输入: 输 ...
- java 外卖店优先级
[问题描述] “饱了么”外卖系统中维护着 N 家外卖店,编号 1 ∼ N.每家外卖店都有 一个优先级,初始时 (0 时刻) 优先级都为 0. 每经过 1 个时间单位,如果外卖店没有订单,则优先级会减少 ...
- springboot发送email邮件
添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>sp ...
- 1-m*n循环填数(用标记数组)blibli2018秋招第三题一个类型
#include <iostream> #include<string> #include<algorithm> using namespace std; ; in ...
- Random Process Modeling_1
1. Bertrand Triangle r=1; %circle radius x0=0; y0=0; %centre of circle %points for circle t=linspace ...
- 八: IO流,数据的读写传输
IO流概括图: IO流的分类: 按流: 输入流(InputStream和Reader):从硬盘或者别的地方读入内存 输出流(OutputStream和Writer):从内存里向硬盘或别的地方输出 按 ...
- hibernate部分源码解析and解决工作上关于hibernate的一个问题例子(包含oracle中新建表为何列名全转为大写且通过hibernate取数时如何不用再次遍历将列名(key)值转为小写)
最近在研究系统启动时将数据加载到内存非常耗时,想着是否有办法优化!经过日志打印测试发现查询时间(查询时间:将数据库数据查询到系统中并转为List<Map>或List<*.Class& ...
- python2学习------基础语法5(文件操作)
1.文件内容读取 a.txt teestttttttttttttt teestttttttttttttt teestttttttttttttt teestttttttttttttt teesttttt ...
- greenplum 存储过程 变量类型
参考: https://www.cnblogs.com/kungfupanda/p/4478917.html
- PHPXhprof扩展在windows安装
1.下载在这里 http://dev.freshsite.pl/php-extensions/xhprof.html.(找不到资源可以私我我给你,这个上传不了资源) 注意:一定要找对应的php版本,t ...