Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 03-07-2005, 08:28 PM   #1 (permalink)
mio
Registered User
 
Join Date: Mar 2005
Posts: 2
mio is on a distinguished road
how do I add a stylesheet to this script?

Okay I found this script to work with font type and color...

Now My question is how can I add a stylesheet to the code and where should I put it..

the name of my stylesheet name is stylesheet.css and is in the same directory that this script is in.

I don't want people to be able to change the text size on the view drop down menu.

Thanks for your help!

__________________________________________________ ___________________________

<script>

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May"," June","July","August","September","October","Novem ber","December")
document.write("<small><font size='3' font color='CCCCCC' face='Arial'><strong><b>///Welcome to The Office: " +dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small>")

</script>
mio is offline   Reply With Quote
Old 03-16-2005, 02:10 PM   #2 (permalink)
webdes
Registered User
 
Join Date: Mar 2005
Posts: 6
webdes is on a distinguished road
If you want to add a style class, let's say for example class="maintext" or something, you could do this:

Code:
<script>

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<div class="maintext><small><font size='3' font color='CCCCCC' face='Arial'><strong><b>///Welcome to The Office: " +dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font></small></div>")

</script>
You would have to specify your CSS in the <HEAD> area of your page.

Ross
webdes is offline   Reply With Quote
Old 03-16-2005, 02:37 PM   #3 (permalink)
mio
Registered User
 
Join Date: Mar 2005
Posts: 2
mio is on a distinguished road
I tried but it doesn't seem to work


my style sheet is stylesheet.css

What would I need to do?

Thanks for the help
mio is offline   Reply With Quote
Old 03-24-2005, 11:29 AM   #4 (permalink)
Cache
Registered User
 
Cache's Avatar
 
Join Date: Mar 2005
Location: Columbus, OH
Posts: 5
Cache is on a distinguished road
Send a message via AIM to Cache
You could use it as an external CSS. In the HEAD of your code, you would add this:
HTML Code:
<link REL="StyleSheet" TYPE="text/css" HREF="stylesheet.css">
That should work unless I am misunderstanding the question/problem at hand.
Cache is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Executing a server script from PHP sde PHP 4 02-05-2005 12:12 PM
running a script at designated time tzarin PHP 5 05-12-2004 08:11 PM
JS Script question M3GAPL3X HTML, XML, Javascript, AJAX 5 04-20-2003 10:21 PM
cgi not working on a new script sde PHP 3 05-20-2002 09:29 PM


All times are GMT -8. The time now is 02:40 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting