Just nu i M3-nätverket
Jump to content

ny rad??


MCS

Recommended Posts

Har följande script på min sida..."tid o datum"

men de står på en rad och jag vill ha tid på översta raden och datum på en rad under...nån som vet hur man gör?

 

 

<title>Datum och text</title>

<STYLE TYPE="TEXT/CSS">

<!--

p { margin-right: 15%; margin-left: 15% }

A:Hover { color: red }

A {text-decoration: none }

 

-->

</STYLE>

</head>

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

 

<body bgcolor="#C0C0C0" text="#FFFFFF" link="#FFFFFF"

vlink="#FFFFFF" alink="#FFFFFF" background="blabg.gif">

<p>

 

<script language="JavaScript" type="text/javascript">

<!--

var today = new Date

var ar = korr(today.getYear());

pad = today.getMinutes();

if (pad < 10) {

pad = "0";

}

else {

pad = "";

}

function korr(ar) {

if (ar < 2000)

ar = ar + 1900;

return ar;

}

 

if((today.getHours() < 12) && (today.getHours() >= 6))

{ document.write("<center><FONT SIZE=4></FONT></center>")}

 

if((today.getHours() >= 12) && (today.getHours() < 18))

{ document.write("<center><FONT SIZE=4></FONT></center>")}

 

if((today.getHours() >= 18) && (today.getHours() <= 23))

{ document.write("<center><FONT SIZE=4></FONT></center>")}

 

if((today.getHours() >= 0) && (today.getHours() < 4))

{ document.write("<center><FONT SIZE=4></FONT></center>")}

 

if((today.getHours() >= 4) && (today.getHours() <= 6))

{ document.write("<center><FONT SIZE=4></FONT></center>")}

 

document.write("<center><FONT SIZE=1 FONT FACE=Verdana>Time: ",today.getHours(),":" ,pad,today.getMinutes())

 

document.write(" Date: ",today.getDate(),"/",today.getMonth()+1,"-",ar,"<br></font></center>")

// -->

</script>

Link to comment
Share on other sites

Olle Nyrén

Byt ut sista raden mot

document.write("<br>Date: ", today.getDate(), "/", today.getMonth()+1, "-", ar, "<br></font></center>")

dvs, lägg in en br-tag.

 

Link to comment
Share on other sites

nää, funkar inte...och varför skulle BR-taggen va där? borde inte den vara efter tid-raden isf? fast det funkade inte heller...

 

aha, nu såg jag...fel Br...ska prova...

[inlägget ändrat 2002-03-14 13:39:41 av Malin]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...