当前位置: 首页 > 图文教程 > 网页制作 > CSS样式表 > CSS布局实例代码:两列布局实例

CSS样式表
css 简单区别ie6,ie7,firefox的写法
解决在IE6下文字溢出(多出一行字)的解决方法小结
纯css 鼠标移上查看大图的效果
css 完美清除浮动的两种解决方案
css 透明度的设置兼容所有浏览器
pre 自动换行的问题
CSS 图片定位的几种方式
div+css学习笔记(IE与fox好多不兼容的问题)
让你的页面对 IE6 显示出黑白色(多浏览器)
li 自适应宽度
样式表达式实现交替显示table行颜色
css 控制图片大小 小于固定值 控制大小
CSS 各种滤镜代码解释 用法案例
针对firefox ie6 ie7 ie8的css样式hack
CSS 样式 层裁剪图片
十个非常实用的CSS属性(IE不支持)
CSS渲染速度改善的十个方法与建议
css z-index 最大值
css z-index 在IE中的迷惑
IE与Firefox中兼容的html设计中使用CSS改变鼠标为手形

CSS样式表 中的 CSS布局实例代码:两列布局实例


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-03   浏览: 127 ::
收藏到网摘: n/a

CSS两列布局,右侧固定,左侧自适应宽度
<div style="width:90%; margin:0 auto;">
   <div style="width:200px; float:right;">这是右侧的内容</div>
   <div style=" margin-right:210px;">这是左侧的内容,自适应宽度</div>
</div>
CSS两列布局,左侧固定,右侧自适应宽度
<div style="width:90%; margin:0 auto;">
   <div style="width:150px; float:left;>这是左侧的内容 固定宽度</div>
   <div style=" margin-left:160px;>中间内容,自适应宽度</div>
</div>
CSS三列布局,左右宽度固定,中间自适应宽度
<div style="width:90%; margin:0 auto;">
   <div style="width:200px; float:right; >这是右侧的内容 固定宽度</div>
   <div style="width:150px; float:left; >这是左侧的内容 固定宽度</div>
   <div style=" margin-left:160px;margin-right:210px;>中间内容,自适应宽度</div>
</div>
 
三列等高布局
<style>
*{ margin:0; padding:0}
#content{overflow:hidden}
#content #left,#content #center,#content #right{margin-bottom:-10000px;padding-bottom:10000px;width:300px;float:left;}
#content #left{background:#f00;}
#content #center{background:#0ff}
#content #right{background:#f0f}
</style>
<div id="content">
 <p id="left">left<br />left<br />left<br />left<br />left<br />left</p>
 <p id="center">center</p>
 <p id="right">right</p>
</div>