Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - document.write - external css
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

document.write - external css

 Post Reply Post Reply Page  <12
Author
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2004 at 7:13pm

what is IS? if you mean the style that would be just simple 10 px arial black font. I use it else where on the some document, so it would match with rest of the document.

I tried to select the words, but there is just simiply nothing there, so it shouldn't be the font color issue.

The reason why I want this in CSS is because it won't change the font size when viewers change the text size in the browser window.

Anyone knows how to do make this work?

The actual working script is this

-------------------------------------

<SCRIPT language=JavaScript>

<!-- 
  var today = new Date()
  var month = today.getMonth()+1
  var year = today.getYear()
  var day = today.getDate()
  if(day<10) day = "0" + day
  if(month<10) month= "0" + month
  if(year<1000) year+=1900

  var TimezoneOffset = -5 
  var localTime = new Date()
  var ms = localTime.getTime()
  + (localTime.getTimezoneOffset() * 60000)
  + TimezoneOffset * 3600000
  var time =  new Date(ms)
  var hour = time.getHours()
  var minute = time.getMinutes()
  var second = time.getSeconds()
  var curTime = "" + ((hour > 12) ? hour - 12 : hour)
  if(hour==0) curTime = "12"
  curTime += ((minute < 10) ? ":0" : ":") + minute
  curTime += (hour >= 12) ? "pm" : "am"
  document.write("<FONT FACE='Arial, Helvetica, sans-serif' SIZE='1' COLOR='black'>")
  document.write("Currently - " + year + " / " + month + " / " + day + "&nbsp;" + "&nbsp;" +  "&nbsp;" + curTime + " US Central Time")
  document.write("</FONT>")
//-->
</SCRIPT>

------------------------------

And, this is the inline style that I did that doesn't work. If the inline style works, it shouldn't be too hard to do the external.

-----------------------------------------

<SCRIPT language=JavaScript>
<!-- 
  var today = new Date()
  var month = today.getMonth()+1
  var year = today.getYear()
  var day = today.getDate()
  if(day<10) day = "0" + day
  if(month<10) month= "0" + month
  if(year<1000) year+=1900

  var TimezoneOffset = -5 
  var localTime = new Date()
  var ms = localTime.getTime()
  + (localTime.getTimezoneOffset() * 60000)
  + TimezoneOffset * 3600000
  var time =  new Date(ms)
  var hour = time.getHours()
  var minute = time.getMinutes()
  var second = time.getSeconds()
  var curTime = "" + ((hour > 12) ? hour - 12 : hour)
  if(hour==0) curTime = "12"
  curTime += ((minute < 10) ? ":0" : ":") + minute
  curTime += (hour >= 12) ? "pm" : "am"
  document.write("<p style="font-family: arial; font-size: 20px; color: black">")
  document.write("Currently - " + year + " / " + month + " / " + day + "&nbsp;" + "&nbsp;" +  "&nbsp;" + curTime + " US Central Time")
  document.write("</p>")
//-->
</script>

--------------------------------------



Edited by Lucent
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2004 at 8:43pm

What Semikilon was asking is that you post the code in the external style sheet.

If you left-click0drag over the area where the code's supposed to be and don't see anything highlighted, it's because there's nothing there. What to you see in the html when you view source? Have you tried it without the first and third document.write statements?


Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.