-
Quick HTML question
I have a small piece of javascript in my HTML that picks a random picture every few seconds and displays it. ( Got it with help from the boards a few days ago, Props!)
I want it to be right againest the edge of the window when viewed, is there any way through alignment tags I can achieve that? <align="left"> doesn't work. No matter what I do, I still end up with a small space a couple millimeteres wide inbetween the pictures and the edge of the window.
Any suggestions?
-
Either in CSS or in the body tag, set margin=0 and padding=0.
-
or try
table border="0" cellpadding="0" cellspacing="0"
and align="left"
-
Follow Ober's suggestion, and also you can try:
<p align="right">
<img....>
</p>
-
Wow... talk about taking the long way around.
-
The problem with...
<p align="right">
<img....>
</p>
is that it isn't actually an image, it's just javascript bringing up images.
-
This is the script if anyone was wondering...
Code:
<script language="javascript">
var delay=2000 //set delay in miliseconds
var curindex=0
var randomimages=new Array()
randomimages[0]="1.jpg"
randomimages[1]="2.jpg"
randomimages[2]="3.jpg"
randomimages[3]="4.jpg"
randomimages[4]="5.jpg"
randomimages[5]="6.jpg"
randomimages[6]="7.jpg"
randomimages[7]="8.jpg"
randomimages[8]="9.jpg"
var preload=new Array()
for (n=0;n<randomimages.length;n++)
{
preload[n]=new Image()
preload[n].src=randomimages[n]
}
document.write('<img name="defaultimage" src="'+randomimages[Math.floor(Math.random()*(randomimages.length))]+'">')
function rotateimage()
{
if (curindex==(tempindex=Math.floor(Math.random()*(randomimages.length)))){
curindex=curindex==0? 1 : curindex-1
}
else
curindex=tempindex
document.images.defaultimage.src=randomimages[curindex]
}
setInterval("rotateimage()",delay)
</script>
-
in <body> set margins to 0, use a div tag to align it to the left
-
not sure why ur saying to do all this stuff tbh
just put in the body tag
<body leftmargin="0"> (and any others you want eg. topmargin="0")
and if u have it in a table do what xxxrugby said as well