代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Css
】
DIV+CSS 布局一行两列,左列固定宽度,右列自适应宽度
作者:
Dezai.CN
/ 发布于
2012/12/6
/
614
平行共三行,中间行分两列,左边固定宽度,右边自适应,并且对行宽度设置了最小值,如果窗口小到最小值以下将出现滚动条
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <style> .divGlobal,.DivTop,.DivBottom{min-width: 760px;width: expression(document.body.clientWidth < 760? "760px": "100%" )/*最小宽度设置*/;width:100%;} .divGlobal{/*border:1px solid #ff0000;*/} .DivTop,.DivBottom,.DivMainLeft,.DivMainRight {border:1px solid #ff0000;} .DivBottom {clear: both;} .DivMainLeft{float:left;} .DivMainRight{margin-left:210px;} .DivFiexWidth{width:200px;} .DivMainRightChild{} .clear{clear: both;} ul.ul1{margin:0px;margin-left:0px;padding-left:0px; /*fiexfox里需要设置此项,否则UR和DIV间会有空白*/} li.li1{margin-left:0px;list-style-type:none;} li.liBg {margin-left:0px;background-color:#ffDD00;list-style-type:none;padding:5px;} </style> </HEAD> <BODY> <script> // alert(document.body.clientWidth); //alert(document.body.clientWidth < 760? "760px": "100%" ); </script> <div class="DivTop"> top </div> <div class="divGlobal"> <div class="DivMainLeft"> <div class="DivFiexWidth"> <ul class="ul1"> <li class ="liBg">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> </ul> </div> <div class="DivFiexWidth"> <ul class="ul1"> <li class ="liBg">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> </ul> </div> <!-- <div class="DivFiexWidth"> <ul class="ul1"> <li class ="liBg">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> </ul> </div> <div class="DivFiexWidth"> <ul class="ul1"> <li class ="liBg">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> </ul> </div> <div class="DivFiexWidth"> <ul class="ul1"> <li class ="liBg">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> <li class ="li1">左边固定宽度</li> </ul> </div> --> </div> <div class="DivMainRight"> <div class="DivMainRightChild" > <ul class="ul1"> <li class ="liBg">右边宽度自适应.</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> </ul> </div> <div class="DivMainRightChild" > <ul class="ul1"> <li class ="liBg">右边宽度自适应.</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> </ul> </div> <div class="DivMainRightChild" > <ul class="ul1"> <li class ="liBg">右边宽度自适应.</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> <li class ="li1">右边宽度自适应</li> </ul> </div> </div> </div> <div class="DivBottom"> DIV+CSS 布局一行两列,左列固定宽度,右列自适应宽度;设置最小宽度,窗口小的时候显示滚动条;firefox ie测试通过. 辛苦几天的结果啊 平行共三行,中间行分两列,左边固定宽度,右边自适应,并且对行宽度设置了最小值,如果窗口小到最小值以下将出现滚动条,这样一来布局就不会乱了. </div> </BODY> </HTML> 若是右侧往下走的话,就把左侧的height设大点
试试其它关键字
同语言下
.
前端PC-移动端CSS公共样式+HTML
.
手机端页面通用样式
.
H5页面通用头部设置
.
elect默认样式美化代码兼容移动端和pc端
.
按钮效果 css
.
唤醒app
.
放大效果
.
html5+css3实现上拉和下拉刷新
.
html上传图片后,在页面显示上传的图片
.
html5实现点击弹出图片
可能有用的
.
前端PC-移动端CSS公共样式+HTML
.
手机端页面通用样式
.
H5页面通用头部设置
.
elect默认样式美化代码兼容移动端和pc端
.
按钮效果 css
.
唤醒app
.
放大效果
.
html5+css3实现上拉和下拉刷新
.
html上传图片后,在页面显示上传的图片
.
html5实现点击弹出图片
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3