Home >php教程 >PHP源码 >wordpress随机背景

wordpress随机背景

PHP中文网
PHP中文网Original
2016-05-25 17:06:451197browse

1. [PHP]代码    

html,
body { height: 100%; }
 
img#bg {
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
}

<body>


<?php $random_image = rand(1, 5); /*let&#39;s choose random image...*/ ?>
<img id="bg" alt="" src="<?php bloginfo(&#39;stylesheet_directory&#39;);?>/images/<?php echo $random_image; ?>.jpg" />

                   

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn