头闻号

济南历下美旺化工经营部

综合性公司|污水处理设备|磷酸

首页 > 新闻中心 > 科技常识:跨浏览器的CSS固定定位
科技常识:跨浏览器的CSS固定定位
发布时间:2023-02-01 09:54:23        浏览次数:3        返回列表

今天小编跟大家讲解下有关跨浏览器的CSS固定定位 ,相信小伙伴们对这个话题应该有所关注吧,小编也收集到了有关跨浏览器的CSS固定定位 的相关资料,希望小伙伴们看了有所帮助。

本文介绍了跨浏览器的CSS固定定位,请看下面的例子:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> …… <style type="text/css"> #fixed{position:fixed;top:5em;right:0;……} </style> <!–[if IE 6]> <style type="text/css"> html{overflow:hidden;} body{height:100%;overflow:auto;} #fixed{position:absolute;right:17px;} </style> <![endif]–> <!–[if lt IE 6]> <style type="text/css"> #fixed{position:absolute;top:expression(eval(document.body.scrollTop 50));} </style> <![endif]–> </head> <body> <div id="wrapper"> …… </div> <div id="fixed"><h2>{position:fixed}</h2></div> </body> </html>

来源:爱蒂网