我在<頭以下>部分回聲顏色隨機不工作
<?php
$rand = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f');
$color = '#'.$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)].$rand[rand(0,15)];
?>
我在<身體下面>
<div class="featured-details" style="background-color: <?php echo $color; ?>;">
當我的頁面加載時,CSS說以下:
<div style="background-color: ;" class="featured-details">
即它看起來沒有顏色正在生成。
任何人都可以幫忙嗎?
做u有權fileextension? .php – sailingthoms
這裏可以工作http://codepad.org/D9abnwZL – j08691
啊,我在head.php中的頭部代碼和body.php中的body。通過將它們都包含在body.php中它可以工作 – dvent