Click to See Complete Forum and Search --> : Need Enlightenment


Zephyr_Mage
12-24-2002, 04:29 AM
I'm new to Javascript and I heard about these .css and .js files.
I'm guessing they're class and javscript files but how do I get them? Do I need to create them? If so how do I create them?

Thanks.

Rick Bull
12-24-2002, 05:04 AM
CSS is a "cascading style sheet" file. CSS is used to add presentation (such as colours, font, etc.) to your page. You can use it to create layout too instead of relying on table. JS is a Javascript file. To use a CSS file you put something like this in your <head>:


<link href="style.css" rel="Stylesheet" type="text/css" />


And to import and external JS file something like this in the <head> or <body>


<script type="text/javascript" src="js_file.js"></script>

Zephyr_Mage
12-24-2002, 05:09 AM
Thanks, that explains a lot but I still don't know where the files come from.

Charles
12-24-2002, 05:35 AM
You make them yourself. The idea is that you are splitting up your page into separate files. This way all the pages on your site can import the same files that are easily edited as required. It also means that browsers that are not running JavaScript will not down load that file that is useless to it, thus saving bandwith.

ozzga
12-25-2002, 02:59 PM
i create them using windows notepad, but simple text editor will work. just create a new text file and then rename it .css or .js

simple, no?

swon
12-25-2002, 04:40 PM
You can create them with an editor or anything else. An CSS file can have the following content:

td {
font-family:arial,verdana,helvetica;
font-size: 9pt;
color:blue;
}

that defines the td tag on your html file
you can use something like that for the most of html tags.



save it to an .css file, for example styles.css;
Include the CSS-file like the description above (Rick Bull).