css 实现网页布局,上中下三部分,中间为固定宽度且分为左右两部分
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>布局</title>
<style>
html,body{
margin:0;
}
.topNav{
border:solid 1px red;
background: red;
position: fixed;
width:100%;
height:60px;
line-height:60px;
text-align: center;
color:#fff;
}
.centerContext{
border:solid 1px blue;
background: #ccc;
position: absolute;
width:1366px;
bottom: 40px;
top:60px;
text-align: center;
color:#fff; left:0;
right:0;
margin:0 auto;
z-index: -1;
}
.footer{
border:solid 1px green;
background: green;
height:40px;
line-height:40px;
position: fixed;
bottom: 0;
width:100%;
text-align: center;
color:#fff;
}
.left{
border:solid 1px #669ae1;
background: #669ae1;
width:300px;
float:left;
height:100%;
margin-bottom: 40px;
overflow: auto;
color:#fff;
}
.right{
border: solid 1px #1d5464;
height:100%;
background: #1d5464;
color:#fff;
overflow: auto;
margin-left: 300px;
}
.right div{height:1000px}
</style>
</head>
<body>
<div class="topNav">头部</div>
<div class="centerContext">
<div class="left">左边</div>
<div class="right">
<div >我是右边里面的内容我的高度是1000px</div>
</div>
</div>
<div class="footer">底部</div>
</body>
</html>
上中下铺满全屏
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>布局</title>
<style>
html,body{margin:0}
.topNav{
border:solid 1px red;
background: red;
position: fixed;
width:100%;
height:60px;
line-height:60px;
text-align: center;
color:#fff;
}
.centerContext{
border:solid 1px blue;
background: #ccc;
position: absolute;
width:100%;
bottom: 40px;
top:60px;
text-align: center;
color:#fff;
left:0;
right:0;
margin:0 auto;
z-index: -1;
}
.footer{
border:solid 1px green;
background: green;
height:40px;
line-height:40px;
position: fixed;
bottom: 0;
width:100%;
text-align: center;
color:#fff;
}
.left{
border:solid 1px #669ae1;
background: #669ae1;
width:20%;
float:left;
height:100%;
margin-bottom: 40px;
overflow: auto;
color:#fff;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.right{
border: solid 1px #1d5464;
height:100%;
width:80%;
background: #1d5464;
color:#fff;
overflow: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
ox-sizing: border-box;
}
.right div{height:1000px}
</style>
</head>
<body>
<div class="topNav">头部</div>
<div class="centerContext">
<div class="left">左边</div>
<div class="right">
<div >我是右边里面的内容我的高度是1000px</div>
</div>
</div>
<div class="footer">底部</div>
</body>
</html>

css 实现的网页布局的更多相关文章

  1. CSS简单的网页布局

    1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="U ...

  2. css基础-定位+网页布局案例

    position:static 忽略top/bottom/left/right或者z-index position:relative 设置相对定位的元素不会脱离文档流 position:fixed 不 ...

  3. DIV+CSS常用的网页布局代码

    单行一列以下是引用片段:body { margin: 0px; padding: 0px; text-align: center; }#content { margin-left:auto; marg ...

  4. CSS网页布局全精通

    在本文中将使用四种常见的做法,结合CSS于结构化标记语法制作两栏布局.很快地就会发现,不用嵌套表格,间隔用的GIF也能做出分栏版面布局. 相关文章:CSS网页布局开发小技巧24则 稍后在"技 ...

  5. 《精通CSS网页布局》读书报告 ----2016-12-5补充

    第一章:CSS布局基础 1.CSS的精髓是布局,而不是样式哦!  (定要好好的研究布局哦,尤其配合html5) 2. html标签的语义性,要好好的看看哦! 3.DTD:文档类型定义. 4.内联--& ...

  6. DIV+CSS常用网页布局技巧!

    以下是我整理的DIV+CSS常用网页布局技巧,仅供学习与参考! 第一种布局:左边固定宽度,右边自适应宽度 HTML Markup <div id="left">Left ...

  7. 一、HTML和CSS基础--网页布局--网页布局基础

    W3C标准: 由万维网联盟制定的一系列标准,包括: 结构化标准语言(HTML和XML) 表现标准语言(CSS) 行为标准语言(DOM和ECMAScript) 倡导结构.样式.行为分离. CSS 规定的 ...

  8. CSS网页布局错位:CSS宽度计算

    为什么计算宽度计算网页像素宽度是为了CSS网页布局整齐与兼容.常见的我们布局左右结构网页或使用padding.margin布局的时候将计算整页宽度,如果不计算无论是宽度过大过小就会出现错位问题. 怎么 ...

  9. PHP.4-DIV+CSS标准网页布局准备工作(下)

    DIV+CSS标准网页布局准备工作 区块属性(区块模型) 属 性 描 述 Margin(注) 是定义区块外边界与上级元素距离的属性,用1到4个值来设置元素的边界,每个值都是长度.百分比或者auto,百 ...

随机推荐

  1. [python] 查找列表中重复的元素

    a = [1, 2, 3, 2, 1, 5, 6, 5, 5, 5] b = set(a) for each_b in b: count = 0 for each_a in a: if each_b ...

  2. JS代码判断IE6,IE7,IE8,IE9

    做网页有时候会用到JS检测IE的版本,下面是检测Microsoft Internet Explorer版本的三种代码! 有一种代码: <script type="text/javasc ...

  3. HashSet和ArrayList有什么区别

    hashSet存储的是无序,不可重复,无索引 ArrayList存储的是有序,可重复,有索引

  4. FJUT16级第一周寒假作业题解I题

    涨姿势题3 TimeLimit:1000ms  MemoryLimit:128000KB 64-bit integer IO format:%lld Problem Description 涨姿势题就 ...

  5. 图解ActiveMQ virtual topic

    http://activemq.apache.org/virtual-destinations.html 普通的 topic 是发布/订阅模式:消息会被广播发送给所有的订阅者,订阅者拿到的是全部消息, ...

  6. sudo执行命令允许教程

    1.说明 在Ubuntu中我们可能经常使用sudo执行一些高权限命令:但在CentOS中默认是不允许普通用户sudo的,如同以下情型 [ls@ls bin]$ sudo ifconfig [sudo] ...

  7. weblogic控制台用户名密码修改

    1.记得用户名密码但想修改密码修改方法 保存后立即生效,即你退出后即能以新密码登录:但由于启动的用户名密码和登录的用户名密码是同一个,所以我们需要去修改DOMAIN_HOME/servers/serv ...

  8. html5手机web app <input type="file" > 只调用图库,禁止调用摄像头?

    <input type="file" accept="image/*"><input type="file" accept ...

  9. 蓝桥杯—ALGO-2 最小最大公倍数

    问题描述已知一个正整数N,问从1~N中任选出三个数,他们的最小公倍数最大可以为多少. 输入格式输入一个正整数N. 输出格式输出一个整数,表示你找到的最小公倍数.样例输入9样例输出504数据规模与约定1 ...

  10. react router @4 和 vue路由 详解(一)vue路由基础和使用

    完整版:https://www.cnblogs.com/yangyangxxb/p/10066650.html 1.vue路由基础和使用 a.大概目录 我这里建了一个router文件夹,文件夹下有in ...