Sign in to follow this  

[web] css not working in firefox

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

If you intended to correct an error in the post then please contact us.

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>
<head>
<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.
</body>
</html>
edit: the formatting is not right on the forum, but the edit text is right.

Share this post


Link to post
Share on other sites
Take the HTML comments out of your css section, or use css comments, e.g:
/* 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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
Quote:
Original post by Ra
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):

*** 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 this post


Link to post
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 this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this