Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > rookie css question

Reply
Thread Tools

rookie css question

 
 
jtrecords@yahoo.com
Guest
Posts: n/a
 
      05-24-2005
I truly tried to get this one on my own...

I am new to javascript, like 2 hours ago.
So I'm messing with an example that inserts the current date in an html
page. I want to keep the example and have my stylesheet fonts applied.


Would someone kindly give me an example of how to get this done? Do I
modify the document.write and where?

::excerpt from test.html::

today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;

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

TIA!
JT

 
Reply With Quote
 
 
 
 
DeltaX
Guest
Posts: n/a
 
      05-24-2005
Hi ,

There are three types of styles : inline , embaded, css stylesheet. I
think you want this type!!

You must first write your style of your elements and name that file a
..css
Then, link that file with html ?.html >>>> But sould in the head e.g.
<head>
<link rel="stylesheet" type="text/css" href="a . css" />

</head>
In addition , modify document.write in JS also inside the head ....

That what I have to tell!

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      05-24-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I truly tried to get this one on my own...
>
> I am new to javascript, like 2 hours ago.
> So I'm messing with an example that inserts the current date in an html
> page. I want to keep the example and have my stylesheet fonts applied.
>
>
> Would someone kindly give me an example of how to get this done? Do I
> modify the document.write and where?
>
> ::excerpt from test.html::
>
> today = days[now.getDay()] + ", " +
> months[now.getMonth()] + " " +
> date + ", " +


You probably want to remove the 'date + ...' line

> (fourdigits(now.getYear())) ;


getFullYear() is pretty widely supported, so why not:

now.getFullYear();


For messing with date and time formats, have a read of Dr. J's pages:

<URL:http://www.merlyn.demon.co.uk/js-index.htm>

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


document.write('<p class="someClass" '
+ 'style="font-family: sans-serif;">'
+ today + '<\/p>');

>
> TIA!
> JT
>



--
Rob
 
Reply With Quote
 
jtrecords@yahoo.com
Guest
Posts: n/a
 
      05-24-2005
I appreciate the help. Should have included more info.
I have this in my html, and what is defined in base.css is working for
fonts, headers, etc:

<link rel="stylesheet" type="text/css" href="assets/base.css" />
</head>

I havent' been able to find an example of document.write that I clearly
see a call to the css, the junk I want to write, or how they work
together. Or is it a better practice to create an element (?) in the
css and use it the document.write statment? Any examples?
I'll try to learn something in the meantime <g>.

 
Reply With Quote
 
Richard Cornford
Guest
Posts: n/a
 
      05-25-2005
(E-Mail Removed) wrote:
<snip>
> I have this in my html,...
>
><link rel="stylesheet" type="text/css" href="assets/base.css" />
> </head>

<snip>
> I'll try to learn something in the meantime <g>.


Prior to worrying about browser scripting, or CSS, it would be a good
idea to learn how to write HTML. The above is not valid HTML, as
feeding it through an HTML validator would rapidly reveal.

Richard.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question about 290,291,270,228 from a rookie duke MCSE 1 02-26-2006 06:36 AM
Rookie question Greg Smith Java 4 10-08-2005 04:54 PM
rookie question - setting a path to a schema Ian XML 4 01-22-2005 03:55 AM
Rookie Question Big E ASP .Net 2 06-17-2004 05:27 AM
rookie question Prowler99 Digital Photography 6 04-30-2004 01:02 AM



Advertisments