首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

关于div填充整个浏览器的有关问题

2012-05-04 
关于div填充整个浏览器的问题想实现div填充整个浏览器并可以看到div的border边框html代码:HTML code!DOCT

关于div填充整个浏览器的问题
想实现div填充整个浏览器并可以看到div的border边框

html代码: 

HTML code
<!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">    html{ border:0; height:100%; }    body{ margin:0px; padding:0px; height:100%; text-align:center; }    .dvmain{ height:100%; border:solid 3px #33CC66; text-align:center; font-size:12px; }</style></head><body>    <div class="dvmain">        <div></div>    </div></body></html>

  运行结果:div最下端的border样式没有了。
  去掉overflow:hidden,div最下端的border样式有了但是浏览器出现了滚动条

  求Html+css高手给看看
 

[解决办法]
HTML code
<!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">    html{ border:0; height:100%; }    body{ margin:0px; padding:0px; height:100%; text-align:center; }    .dvmain{ border:solid 3px #33CC66; margin-top:-6px; text-align:center; font-size:12px; height:100%;}    .dvmain div{ background:#33CC66; height:6px;}</style></head><body>    <div class="dvmain"><div></div></div></body></html> 

热点排行