# [web] css not working in firefox

This topic is 4804 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm saving this code to a file with .html extension and opening it in firefox 1.0. The output is large black text (the default for h1 element). When run in IE, however, it output is correct. What needs to be done in firefox to view this correctly? Thanks.
<html>
<title>
CSS Example 3
</title>
<style type="text/css">
.note { color: orange; font-size: small }
</style>
<body>
<h1 class=note>A generic class that can be applied to any element.
</body>
</html>

edit: the formatting is not right on the forum, but the edit text is right.

##### Share on other sites
/* comment this way */

your code works fine for me when I fix that.

HTH
-grazer

edit: the code above (with no comments now) works fine for me (firefox 1.0/Linux) try cleaning cache/refreshing a few times.

##### Share on other sites
More compliant (NOTE: I haven't worked with HTML in a while; this is likely not perfect but I fixed most of the major errors):

<html><head><title>CSS Example 3</title><style type="text/css">.note{	color:		orange;	font-size:	small;}</style></head><body><h1 class="note">A generic class that can be applied to any element.</h1></body></html>

##### Share on other sites
Wow, thanks, it works now. So the problem was as you said, I was using the wrong comment. I just got to that part in the tutorial. It doesn't seem to be affecting the other selector types. Thanks! Now I can lock IE back up in it's cage.

##### Share on other sites
Quote:
 Original post by RaMore compliant (NOTE: I haven't worked with HTML in a while; this is likely not perfect but I fixed most of the major errors):*** Source Snippet Removed ***

Agreed. When using styles or other HTML attributes it's more standards-compliant to quote the value (eg: surround by quotes).

##### Share on other sites
Golopart: can I ask you what version of Firefox you're using?
Your initial code (and all the other code in this thread) works fine on my Firefox 1.0.
I'm working on a webbased game project, which uses a lot of css. I've managed to make it work and look good in all modern browsers. But if there are issues in older Firefox versions, I'll have to make some major changes. Obviously this would suck big time, but it's better to know it now than later.

##### Share on other sites
WanMaster, did you notice that the original code got edited? What was posted originally is different to what you see now.