New
#1
Changing font size in digital clock gadget
I don't know if anyone here can help me with this, but I found an example of how to make your own digital clock gadget in Windows 7. I liked the fact that it could be customized to any font on my computer, however, I've been trying to edit the code to increase the font size but nothing I do has an effect, including changing "font-size: 10pt;" to anything else.
Here's the html file code:
And here's the XML file code:<html>
<head>
<title>Digital Clock</title>
<style>
body
{
margin: 0;
width: 600px;
height: 200px;
}
#gadgetContent
{
width: 500px;
top: 150px;
text-align: center;
font-family: verdana;
font-size: 10pt;
}
</style>
<script language="javascript">
function showtime()
{
var now=new Date();
var h=now.getHours();
var m=now.getMinutes();
var s=now.getSeconds();
h=(h<10)?"0"+h:h;
m=(m<10)?"0"+m:m;
s=(s<10)?"0"+s:s;
gadgetContent.innerHTML="<h2><font color='orange'>"+h+":</font><font color='cyan'>"+m+":</font><font color='white'>"+s+"</font></h2>";
setTimeout("showtime()",1000);
}
</script>
</head>
<body onLoad="showtime()" bgcolor="black">
<span id="gadgetContent"></span>
</body>
</html>
If you happen to see an error in the code that's preventing me from changing the font size, please let me know.<?xml version="1.0" encoding="utf-8" ?>
<gadget>
<name>DigitalClock</name>
<namespace>Example.Azim</namespace>
<version>1.0.0.0</version>
<author name="Azim">
<info url="www.example.com" />
</author>
<copyright>Azim</copyright>
<description>Digital Clock</description>
<hosts>
<host name="sidebar">
<base type="HTML" apiVersion="1.0.0" src="DigitalClock.html" />
<platform minPlatformVersion="1.0" />
<permissions>Full</permissions>
</host>
</hosts>
</gadget>