Click to See Complete Forum and Search --> : linking to a stylesheet in netscape


akosz
02-02-2004, 05:21 PM
my stles are working in netscape when i embed them in the html file, but when i try and link to a stylesheet it doesn't render properly.

my style sheet is called test.css and contains only:


<!-- BODY TAGS -->
body { font-family: sans-serif;
font-size: 10px;
color: #000000;
text-align: center }

<!-- LINK TAGS -->
a { color: #0000FF; text-decoration: none }
a:hover { text-decoration: underline }


my page is called test.html and contains:


<html>
<head>
<title>Untitled</title>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="test.css">
</head>

<body>
this is some test text<BR><BR><BR><BR>
<A href="http://www.yahoo.com">this is a test link</A><BR>


</body>
</html>


what gives?

*akosz*

Jona
02-02-2004, 05:39 PM
You should use /* comment */ for your comments, instead of the HTML <!-- comment --> comments.

[J]ona

Jona
02-02-2004, 05:42 PM
I just thought I'd explain why I think this would be the problem... When embedded into the HTML, the browser will render <!-- and --> as HTML comments, but when you put it in a CSS file, the browser renders the <!-- and --> as CSS, and it doesn't understand that "CSS" code.

[J]ona

akosz
02-02-2004, 05:58 PM
wow, that was simple.

i forgot where i learned to use the html comments for css pages, i think it was in a book. if i ever come across it again i'll be sure to burn it.

i guess it's never been an issue because i've always just coded to ie or didn't use comments.

thanks so much!

*akosz*

Jona
02-02-2004, 06:07 PM
You're welcome, I'm glad I helped! :)

[J]ona