网页自动满屏实现代码
网站建设 2023-01-28 21:38www.1681989.com免费网站
<!-- / Font Defitions / @font-face {font-family:宋体; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:SimSun; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:新宋体; panose-1:2 1 6 9 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"\@宋体"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"\@新宋体"; panose-1:2 1 6 9 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:modern; mso-font-pitch:fixed; mso-font-signature:3 135135232 16 0 262145 0;} / Style Defitions / p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; marg:0cm; marg-bottom:.0001pt; mso-para-marg-:0cm; mso-para-marg-right:0cm; mso-para-marg-bottom:.5gd; mso-para-marg-left:0cm; mso-para-marg-bottom:.0001pt; text-align:justify; text-justify:ter-ideograph; text-dent:10.0pt; mso-char-dent-count:2.0; mso-pagation:none; font-size:12.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:mor-lat; mso-fareast-font-family:宋体; mso-fareast-theme-font:mor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:mor-lat; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:mor-bidi; mso-font-kerng:1.0pt;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:12.0pt; mso-ansi-font-size:12.0pt; mso-bidi-font-size:12.0pt; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:mor-bidi;} .MsoPapDefault {mso-style-type:export-only; marg-bottom:0cm; marg-bottom:.0001pt; mso-para-marg-bottom:.5gd; mso-para-marg-bottom:.0001pt; text-align:center; text-dent:10.0pt; mso-char-dent-count:2.0;} / Page Defitions / @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:595.3pt 841.9pt; marg:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-marg:42.55pt; mso-footer-marg:49.6pt; mso-paper-source:0; layout-grid:15.6pt;} div.Section1 {page:Section1;} -->
网页自动满屏
以前可以搞个<table>,然后设它的height=”100%”,这样整个表格就充满了页面,再将内容放在这表格内,搞定。可是不知从什么时候开始,突然发现这个属性失效了。
跟头部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
这句有点儿关系。去掉也可以自动满屏,窗口有多大,wdow.document.body.offsetHeight就有多大。
保留这个头部,稍加变通,也可以满屏。
方法是在最外层加个DIV,如下
<div id="divTest" style="width:100%;height:100%;position:absolute;">
注意这个;position:absolute; 一定要有,否则也不起作用。这个DIV就作为整个页面的容器。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://.w3./1999/xhtml">
<body onload="LoadTabPage();">
<div id="divTest" style="width:100%;height:100%;position:absolute;">
……
</div>
</body> </html>
网页自动满屏
以前可以搞个<table>,然后设它的height=”100%”,这样整个表格就充满了页面,再将内容放在这表格内,搞定。可是不知从什么时候开始,突然发现这个属性失效了。
跟头部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
这句有点儿关系。去掉也可以自动满屏,窗口有多大,wdow.document.body.offsetHeight就有多大。
保留这个头部,稍加变通,也可以满屏。
方法是在最外层加个DIV,如下
<div id="divTest" style="width:100%;height:100%;position:absolute;">
注意这个;position:absolute; 一定要有,否则也不起作用。这个DIV就作为整个页面的容器。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://.w3./1999/xhtml">
<body onload="LoadTabPage();">
<div id="divTest" style="width:100%;height:100%;position:absolute;">
……
</div>
</body> </html>
上一篇:详解CSS(层叠样式表)渐进增强
下一篇:CSS 一些使用用法
网站设计
- 静宁会SEO的网站建设公司:全面提升您的网络影
- 提升在线业务的关键:选择最佳的丽水网站建设
- 浙江网站优化发展潜力如何
- 井研专业的网站建设公司:打造您的在线品牌
- 灵山SEO网站建设公司:提升您的在线业务表现
- 蒙城网站建设优化公司:提升您网站表现的理想
- 阳谷企业网站优化:提升线上业务力的关键
- 樟树专业的网站建设公司:打造您在线业务的坚
- 通河百度SEO排名的策略与技巧
- 重庆百度快照排名如何进行精准的客户引流
- 重庆百度快照排名
- 常宁便宜的建站公司:助您轻松打造在线业务
- 巫溪百度网站优化:提升网站曝光率与流量的关
- 湖北整站优化怎么做才能放大客户需求
- 闸北网站建设多少钱?全面解析与预算规划
- 辽宁企业网站优化怎么做电话营销