Rumah  >  Artikel  >  hujung hadapan web  >  怪事,求html高手帮忙,希望一打开浏览器滚动条就在最下面,但ie6和ie9不能同时有效?_html/css_WEB-ITnose

怪事,求html高手帮忙,希望一打开浏览器滚动条就在最下面,但ie6和ie9不能同时有效?_html/css_WEB-ITnose

WBOY
WBOYasal
2016-06-24 12:22:301010semak imbas

<!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><title></title><style type="text/css"><!--body {background-image: url();background-color: #FFFFFF;margin:0; padding:0 10px 0 10px;height:100%;overflow:auto;}.STYLE1 {color: #FFFFFF}body,td,th {font-size: 13px;line-height:150%}a{text-decoration:none;}a:hover{ text-decoration:underline; }#wrap {display:block;bottom:0px;right:1px!important;right:18px;width:955px;line-height:30px;position:fixed;border:1px solid #fff;}*html{overflow-x:auto;overflow-y:auto;} * html #wrap {position:absolute;}--></style></head><body onload='document.body.scrollTop = document.body.scrollHeight;'><br>正文,希望一打开浏览器滚动条就在最下面<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文,希望一打开浏览器滚动条就在最下面<br><br>正文<br><div id="wrap"><table style="width:100%;" cellspacing="0" border="0"><tr><form name="Form" method="post" action="ztcad.php"><td>查询:<input type="text" name="keyword" size="25" onfocus="this.select();"> <input type="submit" name="Submit" value=" 查… " onclick="Javascripts:ockForm();return false;"></td></form><td align="right">固定内容 <td></tr></table></div></body></html>  


如果

那么 在IE6下能正常显示,一打开浏览器就滚动条就能自动到最下面,但在IE9下却无效。

如果改成 在 IE9下能正常显示了,但在IE6下直接打开浏览器滚动条又不能直接在最下面了。

由于 固定搜索框内容不能去掉(如果去掉固定内容的div层,二个代码在各个IE版本下都有效,但 必须要保留这个固定层,当然层的代码也可以帮修改,只要有这个效果即可),所以想请教高手在保留固定搜索框内容的情况下, 如何将滚动条打开网页就显示在最下面,而且要在所有版本的浏览器下都有这效果?


回复讨论(解决方案)

<!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><title></title><style type="text/css"><!--body {background-image: url();background-color: #FFFFFF;margin:0; padding:0 10px 0 10px;height:100%;overflow:auto;}.STYLE1 {color: #FFFFFF}body,td,th {font-size: 13px;line-height:150%}a{text-decoration:none;}a:hover{ text-decoration:underline; }#wrap {display:block;bottom:0px;right:1px!important;right:18px;width:955px;line-height:30px;position:fixed;border:1px solid #fff;}*html{overflow-x:auto;overflow-y:auto;} * html #wrap {position:absolute;}--></style></head> <body onload='if (window.location.href.indexOf("#")<0) {window.location.href = window.location.href+"#footer";}'><br>正文,希望一打开浏览器滚动条就在最下面<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文<br><br>正文,希望一打开浏览器滚动条就在最下面<br><br>正文<br><div id="wrap"><table style="width:100%;" cellspacing="0" border="0"><tr><form name="Form" method="post" action="ztcad.php"><td>查询:<input type="text" name="keyword" size="25" onfocus="this.select();"> <input type="submit" name="Submit" value=" 查… " onclick="Javascripts:ockForm();return false;"></td></form><td align="right">固定内容 <td></tr></table></div><div id='footer'></div></body></html> 

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn