好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

请问各位高手,怎么设置,使得网页窗口中的一张图片一直在浏览器窗口的中央,不管浏览器滚动条怎么拉动(也

html

怎么设置,使得网页窗口中的一张图片一直在浏览器窗口的中央,不管浏览器滚动条怎么拉动(也不管滚轮怎么滚动)


回复讨论(解决方案)

绝对定位不行?

试试下面这段代码:

    模拟position:fixed   * { padding:0; margin:0;}body { height:100%; overflow:hidden; font-size:14px; line-height:2; position:relative;}html { height:100%; overflow:hidden;}.fixed { position:absolute; left:50%; margin-left:-100px; top:50%; margin-top:-100px; width:200px;height:200px; background:#fc0;}.wrapper { height:100%;overflow:auto; overflow-y:scroll;}#content { width:90%; margin:0 auto; background:#f2f2f2; padding:20px;}   

查看更多关于请问各位高手,怎么设置,使得网页窗口中的一张图片一直在浏览器窗口的中央,不管浏览器滚动条怎么拉动(也的详细内容...

  阅读:38次