Click to See Complete Forum and Search --> : a quick question
ukemike
09-19-2003, 07:28 AM
when linking java script and CSS from another file where do you put the link command in the HTML document?? it seems like my HTML page is not reading my CSS.
here is my command:
<link href="scripts/sheet.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="scripts/java.js"></script>
mike
Charles
09-19-2003, 07:38 AM
The LINK (http://www.w3.org/TR/html4/struct/links.html#edef-LINK) element goes only in the HEAD. The SCRIPT element can go in either the HEAD or the BODY element. It is traditional to put as much of the script as one can in the document's HEAD, but any "document.write()" statements will have to go in the BODY.
David Harrison
09-19-2003, 08:46 AM
I always put my document.write()'s in a function and then I just call the function in the body, it's a lot cleaner.
I also avoid referencing external scripts in the body, it just doesn't seem right some how.
ukemike
09-19-2003, 10:44 AM
Why dont this .css work for me??
a:active, a:link {font-family: arial; font-size: 10px;}
a:hover {color: black; font-family: arial; font-size: 10px;}
a:visited {text-decoration: none; color: black;}
.line_width {width: 50%;}
img {border: 0;}
i have the linkage in my <HEAD> section
mike
ukemike
09-19-2003, 10:46 AM
is it because the link is in a div tag on the page that i linked that css to??
David Harrison
09-19-2003, 11:12 AM
That CSS should apply styling to all a tags on a page. Do you have a link to the page that shows the CSS not working?