<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
*{margin: 0padding: 0}
.Ad{
position: fixed
width: 140px
height: 500px
background: #db3e52
top: -moz-calc(50% - 250px)
top: -webkit-calc(50% - 250px)
top: calc(50% - 250px)
}
div.Ad:nth-child(1){
left: 2%
}
div.Ad:nth-child(2){
right:2%
}
</style>
</head>
<body>
<div class="Ad"></div>
<div class="Ad"></div>
</body>
</html>
<!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/htmlcharset=gb2312" />
<title>浮动对联</title>
<style>
#QQFloat{
right: 2px
}
#QQFloat2{
left: 2px
}
.QQFloat2{
background-color:#f61
top: 20px
overflow: hidden
position: absolute
height: 400px
width: 50px
padding:25px
text-align:center
font-size:45px
}
</style>
<script type="text/javascript">
window.onscroll = function MoveQQ(){
document.getElementById("QQFloat").style.top=eval(document.documentElement.scrollTop) + "px"
document.getElementById("QQFloat2").style.top=eval(document.documentElement.scrollTop) + "px"
}
</script>
</head>
<body>
<div style="height:2500pxwidth:749pxmargin:0 auto">为了让网页出现滚动条以便测试加了这个层<br />为了让网页出现滚动条以便测试加了这个层
<br />
为了让网页出现滚动条以便测试加了这个层
</div>
<div class="QQFloat2" id="QQFloat">天增岁月人增寿</div>
<div class="QQFloat2" id="QQFloat2">春满乾坤福满门</div>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)