Hallo,
Ich schreibe gerade an einer Website, die ein zufälliges Bild anzeigen soll. Die ganze Seite ist Zentriert, jedoch wird das Bild links ausgerichtet angezeigt. Dabei habe ich mir aus dem Netz einen Javas***** Code besorgt. So sieht mein Code aus:
Code:
<html>
<head>
<title>Congratulations. You got...</title>
</head>
<body
style="background-image: url(*/bg.png);">
<div style="text-align: center;">
<div style="text-align: center;"></div>
<br>
</div>
<br>
<br>
<br>
<div style="text-align: center;"><big><big><span
style="font-weight: bold;"><span
style="color: rgb(255, 255, 255);">Congratulations. You got</span></span></big></big><br>
<big><big><span style="font-weight: bold;"><span
style="color: rgb(255, 255, 255);"></span></span></big></big></div>
<big><big><span style="font-weight: bold;"><span
style="color: rgb(255, 255, 255);"><br>
<div style=""><br>
<s***** type="text/javas*****">
var imgArray = ['1.png', '2.png', '3.png', '4.png', '5.png', '6.png', '7.png', '8.png'];var basePath="http://www.horshamjudoclub.com/Site/S*****s/Widgets/Timer/odometer/";
function imgRandom() {
for (var i = 0; i < 1; i++) {
var rand = imgArray[Math.floor(Math.random() * imgArray.length)];
var image = new Image();
image.src = basePath+rand;
document.body.appendChild(image);
}
}
imgRandom();
//-->
</s*****>
</div>
</span></span></big></big>
<br>
<br>
<br>
</body>
</html>
Und folgendermaßen sieht die Seite aus (das grüne soll zeigen, was ich möchte):
Ich bin noch nicht sehr erfahren; bin quasi noch ein Neuling.
Ich hoffe ihr könnt mir irgendwie helfen und habt verstanden, was für ein Problem ich habe.
Liebe Grüße
Panda