有段时间看到几个站长的网页上突然出现了一只小虫子在屏幕上到处爬,

感觉挺有意思的,然后就看源码给弄下来了,结果一看,尼玛太简单了方法,下面就是源码步骤,奇思妙想的同学也可以将gif图片替换成其他的图片即可。即便你的高度很高,滚动条怎么下拉它都会出现在屏幕上的。

网页屏幕上有只小虫在到处爬(代码)_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>
<title> new document </title>
<style type="text/css">
.adorn{width: 100%;height: 207px;background: url(bug.gif) no-repeat center;position: fixed;left: 0;top: 0;z-index: -99;}
</style>
<script type="text/javascript">
</script>
</head>

<body>
<!--BUG图片-->
<div class="adorn"></div>

</body>
</html>