font face colour size - where to put the code?

  mco 16:35 02 Jun 2006

I've got three snippets on my site: a 'good morning' one,a date& time one, and a 'last modified' one - but as they're all from different sources they are all different sizes/fonts etc. Below here is I believe the code I need to alter them to whatever font/colour/size I want - but question is: where do I put them into the snippets to get them to work? One of them doesn't actually say anything about fonts/sizes or colours anyway (though it still works)
FONT SIZE=+1 COLOR="000000" FACE="Arial">

  mco 16:36 02 Jun 2006

here's the one which doesn't specify it. So where would I put my requirements?

<p><SCRIPT LANGUAGE="JavaScript">
<!-- Begin
datetoday = new Date();
thehour = datetoday.getHours();
if (thehour > 18) display = "Evening";
else if (thehour >12) display = "Afternoon";
else display = "Morning";
var greeting = ("Good " + display + "!");
// End -->


  Eric10 17:35 02 Jun 2006

Put your font declaration inside the <p> tag. This is an example <p style="font:120% Arial; color:#000000;">. The font size can be altered by varying the percentage.
This is the same as <p style="font-size:120%; font-family:Arial; color:#000000;">

  Eric10 17:44 02 Jun 2006

If you prefer to stick with the html that you have then you can put <font size=+1 color="000000" face="Arial"> immediately after the <p> tag and put </font> immediately before the </p> tag but my first method uses more current code.

  beynac 17:47 02 Jun 2006

The relevant line is:
var greeting = ("<FONT SIZE=+1 COLOR='000000' FACE='Arial'>Good " + display + "!</FONT>");

Note single quotes around the color and face.

  Eric10 17:48 02 Jun 2006

Sorry some errors crept into my last post and the code should read <font size="+1" color="#000000" face="Arial">.

  mco 17:48 02 Jun 2006

will go off and try that then hopefully come back and tick 'resolved'

  mco 17:55 02 Jun 2006

one of you says ' around colour and cace and the other shows " - so which is it?

  Eric10 18:14 02 Jun 2006

The point beynac is making is that you cannot use double quotes inside double quotes. Since the original javascript that he has modified for you already uses double quotes then the parts within this code that also need to use quotes must use single quotes instead. These are the color definition '000000' and the face definition 'Arial'. This is because the javascript will treat a second double quote as a closing quote with unpredictable results.
Either of our methods will work although beynac's is neater as it sits inside the javascript but don't mix parts of my code with parts of his. Just use one or the other.

  mco 18:18 02 Jun 2006

Thanks again - it works and I'm most appreciative! (I even managed to get it into bold myself so I'm doubly happy!)

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Honor 9 Lite review

How Sam Falconer transforms science and geology into digestible, elegant illustrations

HomePod review

Les meilleures séries Netflix (2018)