You cannot use only html and css for this purpose. You should do this on the client side (e.g. with javascript) or on the server side (e.g. php script)
Here's a php example:
<?php $bg = array('bg-01.jpg', 'bg-02.jpg', 'bg-03.jpg', 'bg-04.jpg', 'bg-05.jpg', 'bg-06.jpg', 'bg-07.jpg' ); <style type="text/css"> </style>
Here's a jquery example:
var images = ['image1.jpg', 'image2.jpg', 'image3.jpg', 'image4.jpg', 'image5.jpg']; $('html').css({'background-image': 'url(images/' + images[Math.floor(Math.random() * images.length)] + ')'});
source share