Welcome to WebmasterWorld Guest from 107.20.104.161

Forum Moderators: not2easy

Message Too Old, No Replies

CSS in NS6 doesn't work at all?

     

Jon_King

10:11 pm on Aug 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't seem to find out why styles are not being applied in NS6. I have several very basic type styles/colors which work fine in IE, but its as if they don't exist in NS.

moonbiter

10:13 pm on Aug 27, 2002 (gmt 0)

10+ Year Member



Can you give a short example?

nancyb

10:19 pm on Aug 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've just recently converted everything to CSS and it works fine in NS6.2. Did you run the css file through a validator? That might give you a clue. The one at WDG is a little more helpful with the errors than the one at W3C but use them as final authority.

Jon_King

10:21 pm on Aug 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check this page in both browsers and you'll see what I mean. One example is the first piece of text "Rubber Extrusions" is 24pt Arial in red.

<sorry, no URLs>

[edited by: tedster at 2:30 am (utc) on Aug. 28, 2002]

bobriggs

10:37 pm on Aug 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just to let you know, it doesn't display as 24pt arial in Opera or Moz1.1 either. Only MSIE gets it.

The problem might be with inheritance.

Try <p class="24pt-arial-red"> (your inside <p> in the table).

moonbiter

10:59 pm on Aug 27, 2002 (gmt 0)

10+ Year Member



I believe the problem is that you are beginning your selector with a number. Although it isn't clear in the html recommendations, starting a class name with a number seems to be a problem.

Change the class names in your stylesheet to see what I mean.

Besides, a name like "24-point-arial-red" kind of defeats the purpose of using classes anyway -- what if you decided you wanted to change all of your subheads to 30pt blue helvetica?.

[edited by: moonbiter at 10:59 pm (utc) on Aug. 27, 2002]

Jon_King

10:59 pm on Aug 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I see what you mean, I tried your advice but unfortunately it didn't pay off. There are other styles on the page as well in which inheritance is not a problem and they do not display either.

bobriggs

11:05 pm on Aug 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you need the <p> tag inside the <td>?

moonbiter

11:06 pm on Aug 27, 2002 (gmt 0)

10+ Year Member



Yep, the numbers are definitely it. According to the W3C's CSS Validation Service [jigsaw.w3.org]:

In CSS1, a class name could start with a digit (".55ft"), unless it was a dimension (".55in"). In CSS2, such classes are parsed as unknown dimensions (to allow for future additions of new units) : To make ".12pt-arial-black" a valid class, CSS2 requires the first digit to be escaped

The relevant information can be found in the CSS 2 Recommendation [w3.org]

Jon_King

11:08 pm on Aug 27, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, Moonbiter.

You do make a point regarding class names, I'm just a holdover from print advertising.

BUT, you were exactly correct! Leading numbers as class names are the culprit.

Thanks so much.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month