473,320 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

rookie css question

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

Jul 23 '05 #1
4 1236
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!

Jul 23 '05 #2
jt*******@yahoo.com 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
Jul 23 '05 #3
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>.

Jul 23 '05 #4
jt*******@yahoo.com 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.
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: William S. Perrin | last post by:
I'm a python rookie, anyone have and suggestions to streamline this function? Thanks in advance..... def getdata(myurl): sock = urllib.urlopen(myurl) xmlSrc = sock.read() sock.close() ...
11
by: Don Bruder | last post by:
Got a stumper here. I imagine that for someone experienced in C++, this is too pathetic for words. For a rookie, using this project as a sort of "midterm exam" in his self-taught "how to program in...
6
by: bigjmt | last post by:
Sorry to bother you guys with what I though would be an easy task. I have a table in my database were I would like one of the rows to increment a number for each row. I want the first row to start...
7
by: Sharon | last post by:
Hiya I have a small question, I saw this piece of code somewhere (it's for creating a customized context menu) and I was wondering: Why is it that the STYLE and SCRIPT-tags are broken up into...
8
by: Tom | last post by:
Please help. I need a quick little scrpit to place on a web page that will count how many days have passed since January 1, 1970. I have ZERO experience writing ANY scripts. Anyone have any...
3
by: Dimitris \(GIS\) | last post by:
Hi I am a JavaScript rookie. I have an applet and want to change it's parameters with multiple links in my page. How can I do it? this is my code: <applet code="GIS.class"> <param...
2
by: Daveg | last post by:
Hello, Rookie here. I am new at c# and put together a script which is working fine grabbing some elements from an XML file that I created. The problem is that I would like to put at the top of...
0
by: EZboy | last post by:
Rookie question ..... can anybody please send me a sample code that illustrates : how to display an mpg video clip on a new window that is being opened from within an application ? Many Thanks,...
3
by: Dst | last post by:
Hi i'm trying to make a very simple web site using visual studio 2005. I'm completely noob at this so i need some pointers to get me started. As i understand frames should not be used in...
21
by: AsheeG87 | last post by:
Hey Everyone~ I'm still a C++ Rookie so please bear with me on this. I'm doing a temperature conversion program with prototype functions. Basicly, I was wondering if some of you would take a look...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.