The following code works fine to display 1 of possible 4 background images with a corresponding background color on desktop browsers (see methodally.com). However on iOS, the image only appears when the background is white. When a color background is presented, the image does not appear. All images are the roughly the same size. Any thoughts?
Update: Also tried switching the order of the arrays. No luck. Even when the white background and associated image are last in the array, this is the only combination that appears on iOS.
Here is my index.php
file:
<?php
$bl = array('logo-white.png', 'logo-pink.png', 'logo-blue.png', 'logo-teal.png' );
$bc = array('#fdfdfe', '#b0265d', '#040442', '#43a5ae' );
$i = rand(0, count($bl)-1); // generate random number size of the array
$selectedBl = "$bl[$i]"; // set variable equal to which random filename was chosen
$selectedBc = "$bc[$i]"; // set variable equal to corresponding background color
?>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
html {
width:100%;
height:100%;
background: <?php echo $selectedBc; ?> url(/img/<?php echo $selectedBl; ?>) center center no-repeat;
background-size:60%;
}
</style>
</head>
<body>
</body>
</html>