怎样让div自适应大小? 一个div内嵌套很多div,div里面嵌套table显示数据当在不同大小的屏幕浏览时,div自动伸缩,高度自动调整,里面的内容自动调整。做过的麻烦指点一下。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 - -<div style="width:100%;height:100%"></div> 全部用百分比很难控制,div用百分比,里面的td宽高也用百分比? <div id="center-out" > <div id="center-top" > <div class="fon">中间</div> </div> <div id="center-content" > <iframe frameborder="0" id="main" name="main" src="main.aspx" scrolling="no" marginheight="0" marginwidth="0" style=" width:620px; height: 300px; margin:2px"> </iframe> </div>#center-out{ position:relative;margin-right:1px;float:left;margin-top:10px;left:1px; width:63%;}#center-top{ position:relative;width:128.5%; height:20px;border:0px solid green; line-height:18px; background-color:Orange;float:left;}#center-content{position:relative; height:300px; width:63%;border-left:1px solid Orange ;border-right:1px solid Orange; border-bottom:1px solid Orange; background-image: url(img/bg.jpg);}为什么我center-top的设置成width:128.5%才与center-content的width:63%相等?width是相对哪一个的? div的宽度如果你不去指定的话,他默认是父容器所能显示的100%宽高度,真的是没办法百分比 失效.. 用auto IE7里边就是这个样子的 呵呵 在div里面最好不要去定义网页的高度 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style type="text/css"><!--body { font-family:Arial, Helvetica, sans-serif; font-size:12px; margin:0px; padding:0px; color:#666;}.center { width:96%; margin:0; padding:10px 1%; border:1px solid #ccc; margin:100px auto 10px;}.center table { width:100%; border:0px;}--></style></head><body><div class="center"> <table> <tr> <td>不得不知的java规范与标准 * 众多Java培训大师全套Javaee视频下载 * 构建出色多核应用程序 世界500强企业面试技巧题 IBM dW精华技,开发者必看快速变身java/.net达人秘籍 财富两千强公司都选甲骨文SOA解决方案 IT工程师的技术不得不知的java规范与标准 * 众多Java培训大师全套Javaee视频下载 * 构建出色多核应用程序 世界500强企业面试技巧题 IBM dW精华技,开发者必看快速变身java/.net达人秘籍 财富两千强公司都选甲骨文SOA解决方案 IT工程师的技术互“动”社区不得不知的java规范与标准 * 众多Java培训大师全套Javaee视频下载 * 构建出色多核应用程序 世界500强企业面试技巧题 IBM dW精华技,开发者必看快速变身java/.net达人秘籍 财富两千强公司都选甲骨文SOA解决方案 IT工程师的技术互“动”社区互“动”社区</td> </tr> </table></div></body></html>看看你要是不是这种效果 SCRIPT 与 PHP 参数互传问题 firefox和IE不一致的问题,寻求解决方案 问什么我javascript return false 还能提交? <求助>js和asp.net控件的相互访问? 我的CSS编写要点及技巧整理 我直接打false竟然也能提交 有关图片显示的问题(线程) 关于弹出窗口的问题(高手进来) 在html编辑器中,如何把一段预先准备好的html代码写到ifram中? 页面上点击button后使其禁止点击的javascript函数如何写? 新浪腾讯两大微博表情问题 手机上XML中JS onload不执行。求解决
<div style="width:100%;height:100%"></div>
<div id="center-out" >
<div id="center-top" > <div class="fon">中间</div> </div>
<div id="center-content" >
<iframe frameborder="0" id="main" name="main" src="main.aspx" scrolling="no" marginheight="0" marginwidth="0" style=" width:620px; height: 300px; margin:2px">
</iframe>
</div>
#center-out{ position:relative;margin-right:1px;float:left;margin-top:10px;left:1px; width:63%;}
#center-top{ position:relative;width:128.5%; height:20px;border:0px solid green; line-height:18px; background-color:Orange;float:left;}
#center-content{position:relative; height:300px; width:63%;border-left:1px solid Orange ;border-right:1px solid Orange; border-bottom:1px solid Orange; background-image: url(img/bg.jpg);}为什么我center-top的设置成width:128.5%才与center-content的width:63%相等?width是相对哪一个的?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body { font-family:Arial, Helvetica, sans-serif; font-size:12px; margin:0px; padding:0px; color:#666;}
.center { width:96%; margin:0; padding:10px 1%; border:1px solid #ccc; margin:100px auto 10px;}
.center table { width:100%; border:0px;}
-->
</style>
</head><body>
<div class="center">
<table>
<tr>
<td>不得不知的java规范与标准 * 众多Java培训大师全套Javaee视频下载 * 构建出色多核应用程序 世界500强企业面试技巧题 IBM dW精华技,开发者必看
快速变身java/.net达人秘籍 财富两千强公司都选甲骨文SOA解决方案 IT工程师的技术不得不知的java规范与标准 * 众多Java培训大师全套Javaee视频下载 * 构建出色多核应用程序 世界500强企业面试技巧题 IBM dW精华技,开发者必看
快速变身java/.net达人秘籍 财富两千强公司都选甲骨文SOA解决方案 IT工程师的技术互“动”社区
不得不知的java规范与标准 * 众多Java培训大师全套Javaee视频下载 * 构建出色多核应用程序 世界500强企业面试技巧题 IBM dW精华技,开发者必看
快速变身java/.net达人秘籍 财富两千强公司都选甲骨文SOA解决方案 IT工程师的技术互“动”社区
互“动”社区</td>
</tr>
</table>
</div>
</body>
</html>看看你要是不是这种效果