Why does stylesheet directive not work with FireFox?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • deko

    Why does stylesheet directive not work with FireFox?

    Firefox will not take the following "font-weight:bold" directive in my
    stylesheet. Works fine in IE.

    #rightMenuText h5 {
    font-weight:bold;
    padding-bottom:0px;
    padding-top: 10px;
    margin-bottom:0px;
    }

    If you view http://www.clearpointsystems.com in both FF and IE you can see
    difference. I've been trying different things, but can't seem to get the
    bold font. Is there something wrong with my code? Or is this another quirk
    with FF vs. IE?

    Here's the (abbreviated) code:

    <div id="rightMenu" >
    <div id="rightMenuBo dy">
    <div id="rightMenuTe xt">
    <p>[image]</p>
    <h5>Welcome to CSI</h5>
    [text]
    <h5>Big News!</h5>
    [text]
    <h5>Security Matters</h5>
    [text]
    <h5>[more headings]</h5>
    [more text]


  • deko

    #2
    Re: Why does stylesheet directive not work with FireFox?

    > Firefox will not take the following "font-weight:bold" directive in my[color=blue]
    > stylesheet. Works fine in IE.[/color]

    I figured it out - I was redefining the <h5> tag in the stylesheet. IE
    still rendered it as an h5, but not FF. So it appeared "bold" in IE, but
    only as regular text in FF. The different browsers were rendering the exact
    same code differently - ah yes, the joy of web programming.


    Comment

    • Michael Rozdoba

      #3
      Re: Why does stylesheet directive not work with FireFox?

      deko wrote:[color=blue]
      > Firefox will not take the following "font-weight:bold" directive in my
      > stylesheet. Works fine in IE.[/color]

      It renders it here - XP with FF 1.0.

      However it does still look very different to IE's version. Both are
      bold, but in FF the heading text is approximately 60% of the size of the
      text it heads, hence the bold effect is visually almost lost.

      There's something daft going on with font sizes, nothing more.

      TBH I'd expect FF's behaviour. The div containing the heading has a
      font-size of 10px, so h5 would default to about 6px & I didn't notice
      you explicitly setting a font size elsewhere that would affect h5.

      That IE does its own thing doesn't surprise me - it's clearly decided
      your decision is a <polite>silly </polite> one & it knows better.

      More oddly, Opera 8 does something similar to IE - though if I use the
      web developer toolbar (http://nontroppo.org/wiki/WebDevToolbar) to tell
      me the computed styles for h5 it reports 6px which certainly isn't how
      it renders it. I'd guess they don't necessarily reflect the final
      decisions used in rendering :-/
      [color=blue]
      >
      > #rightMenuText h5 {
      > font-weight:bold;
      > padding-bottom:0px;
      > padding-top: 10px;
      > margin-bottom:0px;
      > }
      >
      > If you view http://www.clearpointsystems.com in both FF and IE you can see
      > difference. I've been trying different things, but can't seem to get the
      > bold font. Is there something wrong with my code? Or is this another quirk
      > with FF vs. IE?
      >
      > Here's the (abbreviated) code:
      >
      > <div id="rightMenu" >
      > <div id="rightMenuBo dy">
      > <div id="rightMenuTe xt">
      > <p>[image]</p>
      > <h5>Welcome to CSI</h5>
      > [text]
      > <h5>Big News!</h5>
      > [text]
      > <h5>Security Matters</h5>
      > [text]
      > <h5>[more headings]</h5>
      > [more text][/color]

      In any case, why are you using a level five heading at that point? What
      happened to h1 to h4? I'd expect these to be nested before a recourse to h5.

      Oh, someone else will probably add font sizes in px are bad(tm) - better
      to use ems or percentages aiui.

      --
      Michael
      m r o z a t u k g a t e w a y d o t n e t

      Comment

      • Alan J. Flavell

        #4
        Re: Why does stylesheet directive not work with FireFox?

        On Thu, 17 Mar 2005, deko wrote:
        [color=blue]
        > Firefox will not take the following "font-weight:bold" directive in my
        > stylesheet. Works fine in IE.
        >
        > #rightMenuText h5 {
        > font-weight:bold;
        > padding-bottom:0px;
        > padding-top: 10px;
        > margin-bottom:0px;
        > }
        >
        > If you view http://www.clearpointsystems.com in both FF and IE you
        > can see difference.[/color]

        #rightMenuText has idiotically specified a font size of 10px, and
        it seems to me that Moz has done just what was asked.

        If I look at 10px Arial in normal and bold weight in Mozilla or FF,
        they look almost same, because they're too tiny to be able to discern
        much difference. They don't need to be embedded deep in some complex
        structure of divs to see this.

        If I would set them a sensible size (I used 1em in my comparison
        test), there's a clear difference between normal and bold.
        [color=blue]
        > with FF vs. IE?[/color]

        Can you explain IE's logic in determining the size of this text?
        Maybe I'm missing something.

        Comment

        • deko

          #5
          Re: Why does stylesheet directive not work with FireFox?

          > It renders it here - XP with FF 1.0.

          I've been making various changes since my post - that may account for the
          varying results at this point.
          [color=blue]
          > That IE does its own thing doesn't surprise me - it's clearly decided
          > your decision is a <polite>silly </polite> one & it knows better.[/color]

          I'm sure my code is not the best - I just wish I got consistent results.
          [color=blue]
          > More oddly, Opera 8 does something similar to IE - though if I use the
          > web developer toolbar (http://nontroppo.org/wiki/WebDevToolbar) to tell
          > me the computed styles for h5 it reports 6px which certainly isn't how
          > it renders it. I'd guess they don't necessarily reflect the final
          > decisions used in rendering :-/[/color]
          [color=blue]
          > In any case, why are you using a level five heading at that point? What
          > happened to h1 to h4? I'd expect these to be nested before a recourse to[/color]
          h5.

          I thought I might use those other <h> tags somewhere else, so I picked one
          that I thought I would not use. Does it matter what it is if I redefine it?
          [color=blue]
          > Oh, someone else will probably add font sizes in px are bad(tm) - better
          > to use ems or percentages aiui.[/color]

          I thought it was better to us px. That's news to me if it's bad(tm). Why?

          Thanks for the reply!


          Comment

          • deko

            #6
            Re: Why does stylesheet directive not work with FireFox?

            > Can you explain IE's logic in determining the size of this text?

            Logic? I'd say it a "feature"

            There's another feature of IE I'd like to figure out. I generate that left
            nav bar with the below PHP code. The problem is the vertical spacing of the
            links is different in IE than it is in FF. Is there a way to get consistent
            spacing? Why are the <p> tags rendered differently by IE than they are in
            FF?

            <?php
            function linkcolor($arg)
            {
            $nav = trim($_GET[nav]);
            if ( $arg == $nav )
            { return "grnlink";}
            else
            { return "blulink";}
            }
            echo "

            <p><span class=".linkcol or('Home Page').">
            <a href='index.php ?nav=Home Page'>Home Page</a>
            </span></p>

            <p><span class=".linkcol or('Contact')." >
            <a href='contact.p hp?nav=Contact' >Contact</a>
            </span></p>

            <p><span class=".linkcol or('Services'). ">
            <a href='services. php?nav=Service s'>Professional Services
            </a></span></p>

            ";
            ?>


            Comment

            • deko

              #7
              Re: Why does stylesheet directive not work with FireFox?

              > I thought it was better to us px. That's news to me if it's bad(tm).
              Why?

              This explains it well -


              But with all the various "features" in all the various browsers, authors
              don't want the presentation of their pages getting screwed up. Thus px is
              more reliable for consistent presentation. Complaints should be sent to the
              browser makers. When my code looks the same in all the different browsers,
              I will stop using px. And as far as I can see (pun intended) the only
              reason *not* to use px is to allow people to change the font size. Well, I
              try to use fonts that are large enough for everyone to read anyway. And, if
              necessary, one can always adjust his monitor resolution.


              Comment

              • Darin McGrew

                #8
                Re: Why does stylesheet directive not work with FireFox?

                deko <deko@hotmail.c om> wrote:[color=blue]
                > This explains it well -
                > http://www.xs4all.nl/~sbpoley/webmatters/fontsize.html
                >
                > But with all the various "features" in all the various browsers,[/color]

                Like minimum font size? Or the ability to ignore document font sizes? Or
                user style sheets that enforce min-width or max-width? Or Opera's new
                Fit-to-Window feature?
                [color=blue]
                > authors don't want the presentation of their pages getting screwed up.
                > Thus px is more reliable for consistent presentation. Complaints should
                > be sent to the browser makers. When my code looks the same in all the
                > different browsers, I will stop using px.[/color]

                Your markup is never going to look the same in all the different browsers.
                That's the reality of the WWW. Using px for font sizes isn't going to
                change that; it just causes your page to break for some potential readers.
                And if your layout relies on your px-based font sizes, then your page can
                break in even more ways when they are ignored.

                See also http://www.westciv.com/style_master/...oil/not_paper/
                [color=blue]
                > And as far as I can see (pun intended) the only reason *not* to use px is
                > to allow people to change the font size. Well, I try to use fonts that
                > are large enough for everyone to read anyway.[/color]

                So how large is "large enough for everyone to read"?

                I know people who can't read fonts that I find comfortable to read. And I
                find it awkward and inconvenient to read the "large print" fonts that they
                need. If you leave the font size alone (using 1em or 100% for normal text),
                then we can all be happy. If you use px, then someone is guaranteed to be
                inconvenienced.
                --
                Darin McGrew, mcgrew@stanford alumni.org, http://www.rahul.net/mcgrew/
                Web Design Group, darin@htmlhelp. com, http://www.HTMLHelp.com/

                "I'd love to make time, if only I could find the recipe."

                Comment

                • David Dorward

                  #9
                  Re: Why does stylesheet directive not work with FireFox?

                  deko wrote:
                  [color=blue]
                  > There's another feature of IE I'd like to figure out. I generate that
                  > left nav bar with the below PHP code. The problem is the vertical spacing
                  > of the links is different in IE than it is in FF.[/color]

                  Browsers are different.

                  Different browsers have different defaults.

                  You are probably experiencing variations in margins and/or padding.
                  [color=blue]
                  > Is there a way to get consistent spacing?[/color]

                  Try specifying the above in your style sheet.

                  [color=blue]
                  > <?php
                  > function linkcolor($arg)
                  > {
                  > $nav = trim($_GET[nav]);
                  > if ( $arg == $nav )
                  > { return "grnlink";}
                  > else
                  > { return "blulink";}
                  > }[/color]

                  This code isn't very readable, it took me a while before I noticed that you
                  aren't prefixing your class names with full stops, but it was PHP syntax.

                  Try this:

                  ?>
                  <p><span class="<?php echo linkcolor('Home Page') ?>">
                  <a href='index.php ?nav=Home Page'>Home Page</a>
                  </span></p>

                  <!-- more links -->
                  ....
                  <?php

                  And I'd suggest you change your markup too. A list of links shouldn't really
                  be marked up as a series of paragraphs. Try using a list instead.



                  --
                  David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
                  Home is where the ~/.bashrc is

                  Comment

                  • Alan J. Flavell

                    #10
                    Re: Why does stylesheet directive not work with FireFox?

                    On Thu, 17 Mar 2005, deko wrote:
                    [color=blue]
                    > authors don't want the presentation of their pages getting screwed
                    > up.[/color]

                    Then they'd do better to ask for what the reader needs, instead of
                    relying on the reader to override whenever the author's demands are
                    inappropriatate .
                    [color=blue]
                    > Thus px is more reliable for consistent presentation.[/color]

                    This is complete nonsense, I'm afraid. The only thing "consistent "
                    about authors who specify px font sizes for my 135dpi desktop display
                    is that I yell "aaargh microfonts" and either leave, or reach for the
                    override.

                    Even *if* browsers implemented the CSS px unit to specification (which
                    in practice they generally don't), it would still make no allowances
                    for individual needs. CSS px units, implemented to spec, might be
                    appropriate for a collective viewing situation (projector, for
                    example) where everyone is forced to view the display at the "same
                    size", but for personal viewing the only reliable unit is the reader's
                    chosen normal text size.
                    [color=blue]
                    > When my code looks the same in all the different browsers,[/color]

                    "Looks the same" on Lynx, mobile phone, theatre projector,
                    IBM HPR? You're missing the point of the WWW.
                    [color=blue]
                    > I will stop using px.[/color]

                    You *will* "stop using px" whenever I need to read your page, no
                    matter what you put into your stylesheet. The harder you try to do
                    the wrong thing, the greater the probability that the reader will have
                    to out-vote you. And on the WWW the reader always gets the last word.

                    Comment

                    • Michael Rozdoba

                      #11
                      Re: Why does stylesheet directive not work with FireFox?

                      deko wrote:
                      [color=blue]
                      > I wrote:
                      >[color=green]
                      >> In any case, why are you using a level five heading at that point?
                      >> What happened to h1 to h4? I'd expect these to be nested before a
                      >> recourse to h5.[/color]
                      >
                      > I thought I might use those other <h> tags somewhere else, so I
                      > picked one that I thought I would not use. Does it matter what it is
                      > if I redefine it?[/color]

                      Not in terms of how it will appear in a browser following your styles,
                      however... firstly, some won't; secondly, html is much easier to
                      interpret if the available elements are used to mark up your content's
                      structure as appropriately as possible & hence are used to convey as
                      much information about the document structure as possible.

                      If when you need an h<x> you arbitrarily choose the <x>, you lose the
                      chance to use that number to tell the reader something specific /about/
                      the heading required at that point.

                      By sticking to having a single h1 per page & thereafter ensuring h2 to
                      h6 are nested in that order, the h<x> at any point now reflects the
                      degree of subdivision of a document, iyswim?

                      eg

                      h1
                      h2
                      h2
                      h3
                      h4
                      h3
                      h4
                      h2
                      [color=blue]
                      > I thought it was better to us px. That's news to me if it's bad(tm).
                      > Why?[/color]

                      I see others have commented on this ;)

                      --
                      Michael
                      m r o z a t u k g a t e w a y d o t n e t

                      Comment

                      • deko

                        #12
                        Re: Why does stylesheet directive not work with FireFox?

                        > You *will* "stop using px" whenever I need to read your page, no[color=blue]
                        > matter what you put into your stylesheet. The harder you try to do
                        > the wrong thing, the greater the probability that the reader will have
                        > to out-vote you. And on the WWW the reader always gets the last word.[/color]

                        This whole argument hinges on one question: Should users be allowed to
                        adjust the font size in a web page? As long as you don't make things too
                        small, I don't think its an issue. Folks with poor eyesight will probably
                        have a monitor resolution setting that accommodates their needs anyway,
                        without having to adjust font sizes in web pages.

                        Still, what you've not so eloquently argued is that, yes, people should be
                        able to adjust the font size in a web page. But you also seem to be saying
                        that you *will* override my settings if use px. So what difference does it
                        make? Is it harder for you to adjust the font size when I use px?

                        I looked for alternate font sizes recently as I was authoring another page.
                        The code completion feature in Dreamweaver - when coding a stylesheet -
                        lists font-sizes in px-denominated values and also "large" and "small". I
                        didn't see any other options in the drop-down list. Call me lazy, but I
                        didn't look for alternate sizes beyond that.

                        I can't say I've found anything persuasive enough on Stephen Poley site, or
                        in your rant, to change something that's been working so well for so long.


                        Comment

                        • Alan J. Flavell

                          #13
                          Re: Why does stylesheet directive not work with FireFox?

                          On Sat, 19 Mar 2005, deko wrote:
                          [color=blue]
                          > This whole argument hinges on one question:[/color]

                          Not at all.
                          [color=blue]
                          > Should users be allowed to adjust the font size in a web page?[/color]

                          In our jurisdictions it's illegal to even /try/ to stop them - even
                          though the attempt is futile, because, in a WWW context, the user
                          always has the last word anyway.
                          [color=blue]
                          > As long as you don't make things too small,[/color]

                          The author can have no idea what's "too small" for each reader.
                          Only the reader knows that. Once you've managed to grasp that idea,
                          everything else falls into place.
                          [color=blue]
                          > I don't think its an issue.[/color]

                          (oh yes you do, or you wouldn't be arguing on this thread.)
                          [color=blue]
                          > Folks with poor eyesight will probably have a monitor resolution
                          > setting that accommodates their needs anyway,[/color]

                          Eh? When readability is an issue, it's best to set the resolution as
                          high as the display can naturally accommodate, and zoom the material
                          to suit.
                          [color=blue]
                          > Still, what you've not so eloquently argued is that, yes, people
                          > should be able to adjust the font size in a web page.[/color]

                          Erm, I've merely pointed out that some people /will/ adjust it if they
                          need to. That's a fact, not an opinion. My *opinion* is that it's a
                          good idea to take the facts into account when deciding on one's
                          authoring style. The flexible style of authoring is the one which
                          best fits the facts.
                          [color=blue]
                          > But you also seem to be saying
                          > that you *will* override my settings if use px.[/color]

                          My normal browser (Mozilla) configuration (for the 135dpi desktop
                          settings) - when I'm not being asked to critique a page's design -
                          sets a minimum font size of 15px, so yes, if you ask for anything less
                          you won't get it. (On the laptop it's 13px).
                          [color=blue]
                          > So what difference does it make? Is it harder for you to adjust the
                          > font size when I use px?[/color]

                          For me, "no": for the majority of MSIE users, "yes".

                          I'm just trying to guide you to an understanding that asking for
                          something that's inappropriate to a proportion of your users - trying
                          to rely on them overriding it (they aren't all as well-informed about
                          their browser's capabilities as I am, after all) is quite unnecessary,
                          when there's a size unit (100% or 1em) that achieves its intended
                          purpose for all of them.
                          [color=blue]
                          > I can't say I've found anything persuasive enough on Stephen Poley
                          > site, or in your rant, to change something[/color]

                          It's OK: your inflexible approach to this topic has been clear from
                          the start. My participation here wasn't intended for you, it was for
                          anyone reading this thread who is willing to consider what they're
                          really doing.
                          [color=blue]
                          > that's been working so well for so long.[/color]

                          If you say so. Bye.

                          Comment

                          • Jan Roland Eriksson

                            #14
                            Re: Why does stylesheet directive not work with FireFox?

                            On Sat, 19 Mar 2005 06:06:55 GMT, "deko" <deko@hotmail.c om> wrote:

                            [Alan J. Flavell wrote...][color=blue][color=green]
                            >> You *will* "stop using px" whenever I need to read your page, no
                            >> matter what you put into your stylesheet. The harder you try to do
                            >> the wrong thing, the greater the probability that the reader will have
                            >> to out-vote you. And on the WWW the reader always gets the last word.[/color][/color]
                            [color=blue]
                            >This whole argument hinges on one question: Should users be allowed to
                            >adjust the font size in a web page?[/color]

                            Yes of course!

                            If I invite a guest into _my_ house I have the right to expect the guest
                            to accept and follow my house rules.

                            If I invite your web pabe into _my_ browser I have the right to expect
                            your page to accept and follow my browsers house rules.

                            In either case the soultion is simple;

                            [an invited guest | your web page] breaks my house rules?
                            then expect to be kicked out in the cold.

                            [...]

                            --
                            Rex


                            Comment

                            • deko

                              #15
                              Re: Why does stylesheet directive not work with FireFox?

                              > If I invite a guest into _my_ house I have the right to expect the guest[color=blue]
                              > to accept and follow my house rules.
                              >
                              > If I invite your web pabe into _my_ browser I have the right to expect
                              > your page to accept and follow my browsers house rules.
                              >
                              > In either case the soultion is simple;
                              >
                              > [an invited guest | your web page] breaks my house rules?
                              > then expect to be kicked out in the cold.[/color]


                              Comment

                              Working...