<?php
    $image = ['image path', 'image path', 'image path'];
  ?> 
html
		{ 
			background: url(<?php echo   $backgroundImage = $image[mt_rand(0, count($image) - 1)]; ?>) no-repeat center center fixed; 
			-webkit-background-size: cover;
			-moz-background-size: cover;
			-o-background-size: cover;
			background-size: cover;
			overflow-x: hidden;
		}

Generate random images with php and css

    17 days later
    Write a Reply...