Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / December 2007

Tip: Looking for answers? Try searching our database.

Font Styles in JavaScript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shelley - 30 Nov 2007 14:38 GMT
Hi,
To begin with I know absolutely nothing about javascript.........
I placed coding on my page to display to the date everyday but I would like
to change the font style........
This is the coding:

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)    {
    return (number < 1000) ? number + 1900 : number;
                                }

// Join it all together
today =  days[now.getDay()] + ", " +
        months[now.getMonth()] + " " +
        date + ", " +
        (fourdigits(now.getYear())) ;

// Print out the data.
document.write(today);

//  End -->
</script>

I don't like the font style that is being used and would therefore like to
change it.  Please help............
GeoffMcGrath - 03 Dec 2007 05:20 GMT
You can try something like this:
document.write("<div style='font-family:Arial;color:blue'>" + today +
"</div>");

The best thing to do is probably to read up on CSS.  Here's some
helpful links:

http://www.w3schools.com/css/css_font.asp
http://www.codestyle.org/css/font-family/

You're likely to get better help in a forum specific to javascript as
used in a browser....this forum is mostly oriented to jscript.net.
comp.lang.javascript might be a place to start...also, groups related
to CSS will best help with styling questions

Good luck!
Shelley - 03 Dec 2007 11:50 GMT
Hi, thank you for your response.

> You can try something like this:
> document.write("<div style='font-family:Arial;color:blue'>" + today +
[quoted text clipped - 12 lines]
>
> Good luck!

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.