div+css做的网站,如何在不同分辨率下都全屏显示?
div+css做的网站,如何在不同分辨率下都全屏显示?请高手指点.网站的结构是这样子的,顶部,中间,底部然后中间部分又分2列,其中左边列固定宽度,比如宽度都是200px,...
div+css做的网站,如何在不同分辨率下都全屏显示?请高手指点.网站的结构是这样子的,顶部,中间,底部然后中间部分又分2列,其中左边列固定宽度,比如宽度都是200px,而右边我想要它自适应,我做了一下,如果内容太多会自适应的被挤到下边,想让左右在一个水平面上这样子如何定义CSS,让页面在不同分辨率下都全屏显示?希望高手能详细指点,谢谢
展开
5个回答
展开全部
<!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;}
li.li1 { margin-left:0px; list-style-type:none; }
li.liBg { margin-left:0px; background-color:#ffDD00; list-style-type:none; padding:5px; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</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">1111111右边宽度自适应.</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>
<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;}
li.li1 { margin-left:0px; list-style-type:none; }
li.liBg { margin-left:0px; background-color:#ffDD00; list-style-type:none; padding:5px; }
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</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">1111111右边宽度自适应.</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>
展开全部
不建议这么做,你做多了,会发现这样会影响布局和美观。也没有网站是这么做的,最多是头部,尾部伸展。中间主题还是设定一定的宽度。
如果你要做,就把宽度不要设死,不要设成固定像素,可以设为百分比。注意,如果有表格也要设定成百分比。还有背景和一些固定的图像最好考虑简单的平铺,或者适应好变化后的效果。
如果你要做,就把宽度不要设死,不要设成固定像素,可以设为百分比。注意,如果有表格也要设定成百分比。还有背景和一些固定的图像最好考虑简单的平铺,或者适应好变化后的效果。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在做网页的时候切忌不要用 百分比%
因为他会在不同的分辨率和版本中出现乱码 排版错误
因为他会在不同的分辨率和版本中出现乱码 排版错误
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
那宽度就不要设px.而设成%,这样可以都全屏,但是肯定有的分辩率下不太美观。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把宽定成100%;{width=100%;}应该就行了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询