DIV+CSS布局问题 100%的页面上边固定高度下面div:height100%填充为左右结构左边固定宽度右边width:100%

html-css016

DIV+CSS布局问题 100%的页面上边固定高度下面div:height100%填充为左右结构左边固定宽度右边width:100%,第1张

<style>

*{ padding:0margin:0}

body{ position:relativewidth:100%height:100%min-height:600pxmin-width:800pxoverflow:hidden}

#header{ height:100pxposition:absolutetop:0width:100%padding-bottom:5pxbackground: #F36}

#middle{ height:100%width:100%bottom:0background:#eee}

#left{ position:absoluteleft:0top:105pxheight:100%width:220pxbackground:#9C3overflow-y:autooverflow-x:hidden}

#right{ margin-left:220pxpadding-top:105pxbackground: #63Foverflow-y:autooverflow-x:overheight:100%}

</style>

<div id="header">

<table width="100%" border="0">

<tr>

<td rowspan="2" align="center" width="85"><img src="jiaoben2613/images/logo.png" width="85" height="85" /></td>

<td>西南民族大学继续教育学院综合管理系统</td>

<td>欢迎系统管理员登录</td>

</tr>

<tr>

<td colspan="2">

<div><a href="#">新闻中心</a><a href="#">新闻中心</a><a href="#">新闻中心</a><a href="#">新闻中心</a><a href="#">新闻中心</a><a href="#">新闻中心</a></div>

</td>

</tr>

</table>

</div>

<div id="middle">

<div id="left"><p>左边</p><div style=" width:100pxheight:1000pxborder:1px #000 solid"></div></div>

<div id="right"><p>右边</p><div style=" width:100pxheight:1000pxborder:1px #000 solid"></div></div>

</div>

试试这样可以不?或者 你就用表格好了!

关键在于:你搞懂xhtml和html的区别没有。

按你的代码,html下盒子尺寸是600x500,xhtml下盒子尺寸是800x700,这个结果是正确的。

xhtml的头部比html头部多一句代码,你用记事本写的时候是否写了这句代码把网页声明为xhtml?

而你用dw的时候,软件自动给你加上了那句声明的。

另外,dw按快捷键是打表格做网页之神器,但做div+css网页的话,dw丢得越远越好,记事本都确实比它好很多。