Bonjour à tous,
Je n'y connais rien en PHP et, à passé 77 ans, je n'ai plus le temps d'aller à l'école.
J'utilise du PHP dans mes programmes, mais sans pouvoir modifier les fonctions.
J'ai une routine qui fonctionne parfaitement pour afficher jusqu'à 20 images de 1000x600 pixels en fond d'écran.
Mais !!!! je voudrais modifier la position d'affichage pour décaler l'image vers la droite. Après moult essais, j'ai cru comprendre que l'image aléatoire est centrée sur la css body
Est-il possible de changer la liaison pour changer la position ?
mon code source
<style type="text/css">
body { height: 100%; width: 100%; text-align: center; background-image: url(fond_cisalpin-region.png); line-height: 20%; }
fond_page { position: fixed; top: auto; height: 600px; width: 1000px; text-align: center; }
</style>
</head>
<body>
<?php
$nbimages=10;
$nomimages[1]="bg_1.jpg";
$nomimages[2]="bg_2.jpg";
$nomimages[3]="bg_3.jpg";
$nomimages[4]="bg_4.jpg";
$nomimages[5]="bg_5.jpg";
$nomimages[6]="bg_6.jpg";
$nomimages[7]="bg_7.jpg";
$nomimages[8]="bg_8.jpg";
$nomimages[9]="bg_9.jpg";
$nomimages[10]="bg_10.jpg";
srand((double)microtime()*1000000);
$affimage=rand(1,$nbimages);
?>
<div id="fond_page">
<img src="image/<?echo $nomimages[$affimage];?>" border=0 width=500 height=300 alt="Image aléatoire">
</div>
</body>
Un champion en PHP peut-il me dire si ce que je voudrais est réalisable facilement ?
M'indiquer ce que je dois modifier !
Merci d'avance de vos réponses



