Olle Larsson Posted January 30, 2005 Share Posted January 30, 2005 Hur får jag texten som ett javascript ger om senast ändrat-datum att med hjälp av CSS2 ligga längst ned på en webbsida? Jag vill ha texten längst ned på sidan oavsett skärmstorlek/upplösning och placerad i en meny med länkar som finns till vänster på webbsidan. Link to comment Share on other sites More sharing options...
Loverman Posted February 22, 2005 Share Posted February 22, 2005 Något sådant här kanske?: [log] <Style> #clock {position:absolute; bottom:10px; left:10px; border:1px solid black; background-color:#DDDDDD; width:100px; height:20px;} </style> <Script Language="Javascript"> function Clock() { if (!document.getElementById) return; theclock=document.getElementById("clock"); now = new Date(); var y1 = now.getFullYear(); var m1 = now.getMonth()+1; var d1 = now.getDate(); hours=now.getHours(); mins=now.getMinutes(); secs=now.getSeconds(); if (secs < 10) secs= "0" + secs; if (mins < 10) mins= "0" + mins; theclock.innerHTML = y1 + '-' + m1 + '-' + d1 + ' (' + hours + ":" + mins + ":" + secs + ')'; window.setTimeout("Clock();",250); } </Script> <body onLoad="Clock();"> <div ID="clock">Loading clock...</div> </body> [/log] Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.