font sizing problem

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

    font sizing problem

    I've got some CSS that looks like this:

    body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 140.01%;
    color: #000000;
    }

    but IE won't apply the font size to text in table cells so I've had to
    modify it to this:

    body {
    margin: 0;
    }

    body, td {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 140.01%;
    color: #000000;
    }

    This "fixes" it in IE buy in MZ the font size in table cells is too
    large. I believe it's 140.01% of 140.01%. I think the only way around
    this is to load a specific style sheet depending on the the browser.

    Is this the right way to go about this or is there a better way?


    Andrew Poulos

    PS the .01% was added because someone told me to and I didn't know
    enough about fonts to disagree.
  • Chris Leipold

    #2
    Re: font sizing problem

    Hi,

    Andrew Poulos wrote:[color=blue]
    > [...]
    > Is this the right way to go about this or is there a better way?[/color]
    What IE-Version?
    Is your code valid?
    Do you have an example-page?
    How do you exactly want the font-size?

    Chris

    Comment

    • Andrew Poulos

      #3
      Re: font sizing problem

      Chris Leipold wrote:
      [color=blue]
      > Hi,
      >
      > Andrew Poulos wrote:[color=green]
      > > [...]
      > > Is this the right way to go about this or is there a better way?[/color]
      > What IE-Version?[/color]
      V.6
      [color=blue]
      > Is your code valid?[/color]
      It checks out with http://validator.w3.org/check
      [color=blue]
      > Do you have an example-page?[/color]
      I don't have a URL to a page but here's the code:

      <?xml version="1.0" encoding="iso-8859-1"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <title>test</title>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <meta http-equiv="Content-Style" content="text/css" />
      <style type="text/css">
      <!--
      body {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 200.01%;
      }
      #layer1 {
      cursor: pointer;
      position: absolute;
      left: 210px;
      top: 120px;
      width: 600px;
      background-color: #ccffff;>
      }
      -->
      </style>
      </head>
      <body>

      <div id="layer1">
      <table width="100%">
      <tr>
      <td width="20"><img id="img0" src="btn_norm.p ng" alt="bullet"
      title="bullet point" width="18" height="18" /></td>
      <td>This is the first line.</td>
      </tr>
      </table>
      </div>

      </body>
      </html>
      [color=blue]
      > How do you exactly want the font-size?[/color]

      If 100% is typically 12 point then I'm assuming/hoping that 200% is
      24pt. 200% is the size I want.

      The text in table cells displays at 100% in IE6. In MZ it displays at
      200%. If I change the CSS selector from "body" to "body, td" then the
      text in table cells displays at 200% (which is what I want) in IE but at
      400% (which I don't want) in MZ.

      Andrew Poulos

      Comment

      • Lauri Raittila

        #4
        Re: font sizing problem

        in comp.infosystem s.www.authoring.stylesheets, Andrew Poulos wrote:[color=blue]
        > I've got some CSS that looks like this:
        >
        > body { font-size: 140.01%; }
        >
        > but IE won't apply the font size to text in table cells so I've had to
        > modify it to this:[/color]

        Why are you using 140% font for body?
        [color=blue]
        > body, td {font-size: 140.01%; }[/color]

        body will be 140% of normal
        td will be 140% from body font. So about twice as big as normal.

        Use
        td {font-size:inherit}
        it might work.
        [color=blue]
        > This "fixes" it in IE buy in MZ the font size in table cells is too
        > large. I believe it's 140.01% of 140.01%. I think the only way around
        > this is to load a specific style sheet depending on the the browser.
        >
        > Is this the right way to go about this or is there a better way?[/color]
        [color=blue]
        > PS the .01% was added because someone told me to and I didn't know
        > enough about fonts to disagree.[/color]

        Not usually needed. IIRC, that was for Opera 6 on some special cases.

        --
        Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>

        Comment

        • Lauri Raittila

          #5
          Re: font sizing problem

          in comp.infosystem s.www.authoring.stylesheets, Andrew Poulos wrote:[color=blue]
          > Chris Leipold wrote:[/color]
          [color=blue][color=green]
          > > Is your code valid?[/color]
          > It checks out with http://validator.w3.org/check
          >[color=green]
          > > Do you have an example-page?[/color]
          > I don't have a URL to a page but here's the code:[/color]

          Bad thing. I have no idea what mime type is used...
          [color=blue]
          > <?xml version="1.0" encoding="iso-8859-1"?>
          > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">[/color]

          You get quirks mode in IE with that doctype. Also, XHTML transitional is
          very stupid choise. Use strict, and if you want it to work in IE use
          HTML4 strict. (or drop xml prolog, and let browsers believe your XHTML
          is HTML)
          [color=blue]
          > <style type="text/css">
          > <!--
          > body {[/color]
          ....[color=blue]
          > background-color: #ccffff;>
          > }
          > -->
          > </style>[/color]

          Hm you don't have any styles? Didn't you know that in XHTML, comments
          inside style block are comments?
          [color=blue][color=green]
          > > How do you exactly want the font-size?[/color]
          >
          > If 100% is typically 12 point then I'm assuming/hoping that 200% is
          > 24pt.[/color]

          Irrelevant.
          [color=blue]
          > 200% is the size I want.[/color]

          Why do you want 200%?
          [color=blue]
          > The text in table cells displays at 100% in IE6. In MZ it displays at
          > 200%.[/color]

          IE is in quirks mode, so it is implementing old bug of not inheriting
          stuff on tables.
          [color=blue]
          > If I change the CSS selector from "body" to "body, td" then the
          > text in table cells displays at 200% (which is what I want) in IE but at
          > 400% (which I don't want) in MZ.[/color]

          That is because you ask it to be 400%.


          --
          Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>

          Comment

          • Chris Leipold

            #6
            Re: font sizing problem

            Hi Andrew,
            [color=blue][color=green]
            >><?xml version="1.0" encoding="iso-8859-1"?>
            >><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            >>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">[/color][/color]

            like Lauri pointed out, the xml-declaration causes IE to use
            quirks-mode. You have to omit it and use a meta-element for the
            encoding. Then your page should render same on IE.
            [color=blue][color=green]
            >>If I change the CSS selector from "body" to "body, td" then the
            >>text in table cells displays at 200% (which is what I want) in IE but at
            >>400% (which I don't want) in MZ.[/color]
            >
            > That is because you ask it to be 400%.[/color]

            "body, td" means body *and* td. The result is body 200% and td 200% of
            200% -> 400%

            hth.

            Comment

            • Neal

              #7
              Re: font sizing problem

              On Fri, 26 Nov 2004 20:19:51 +1100, Andrew Poulos <ap_prog@hotmai l.com>
              wrote:
              [color=blue]
              > I've got some CSS that looks like this:
              >
              > body {
              > margin: 0;
              > font-family: Arial, Helvetica, sans-serif;
              > font-size: 140.01%;
              > color: #000000;
              > }
              >
              > but IE won't apply the font size to text in table cells so I've had to
              > modify it to this:
              >
              > body {
              > margin: 0;
              > }
              >
              > body, td {
              > font-family: Arial, Helvetica, sans-serif;
              > font-size: 140.01%;
              > color: #000000;
              > }
              >
              > This "fixes" it in IE buy in MZ the font size in table cells is too
              > large. I believe it's 140.01% of 140.01%.[/color]

              That would be correct CSS interpretetion. Instead, set body to the percent
              size you want and the table element to 100% or 1em.

              However, I'm betting you are using a transitional, or no, DTD and that's
              really what;s causing the problem. Do I win?

              Comment

              • vatore

                #8
                Re: font sizing problem


                Uzytkownik "Andrew Poulos" <ap_prog@hotmai l.com> napisal w wiadomosci
                news:41a6f51a$0 $25771$5a62ac22 @per-qv1-newsreader-01.iinet.net.au ...[color=blue]
                > I've got some CSS that looks like this:
                >
                > body {
                > margin: 0;
                > font-family: Arial, Helvetica, sans-serif;
                > font-size: 140.01%;
                > color: #000000;
                > }
                >
                > but IE won't apply the font size to text in table cells so I've had to
                > modify it to this:
                >
                > body {
                > margin: 0;
                > }
                >
                > body, td {
                > font-family: Arial, Helvetica, sans-serif;
                > font-size: 140.01%;
                > color: #000000;
                > }
                >
                > This "fixes" it in IE buy in MZ the font size in table cells is too
                > large. I believe it's 140.01% of 140.01%. I think the only way around
                > this is to load a specific style sheet depending on the the browser.
                >
                > Is this the right way to go about this or is there a better way?
                >
                >
                > Andrew Poulos[/color]

                body { font-size: 140%; }
                * html td { font-size: 140%; }




                Comment

                • Lauri Raittila

                  #9
                  Re: font sizing problem

                  in comp.infosystem s.www.authoring.stylesheets, vatore wrote:
                  [color=blue]
                  > body { font-size: 140%; }
                  > * html td { font-size: 140%; }[/color]

                  Don't use ugly hacks to cure IE when problem quirks mode.

                  --
                  Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>

                  Comment

                  • Andrew Poulos

                    #10
                    Re: font sizing problem

                    Lauri Raittila wrote:[color=blue]
                    > in comp.infosystem s.www.authoring.stylesheets, Andrew Poulos wrote:
                    >[color=green]
                    >>Chris Leipold wrote:[/color]
                    >
                    >[color=green][color=darkred]
                    >>>Is your code valid?[/color]
                    >>
                    >>It checks out with http://validator.w3.org/check
                    >>
                    >>[color=darkred]
                    >>>Do you have an example-page?[/color]
                    >>
                    >>I don't have a URL to a page but here's the code:[/color]
                    >
                    >
                    > Bad thing. I have no idea what mime type is used...
                    >
                    >[color=green]
                    >><?xml version="1.0" encoding="iso-8859-1"?>
                    >><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                    >>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">[/color]
                    >
                    >
                    > You get quirks mode in IE with that doctype. Also, XHTML transitional is
                    > very stupid choise. Use strict, and if you want it to work in IE use
                    > HTML4 strict. (or drop xml prolog, and let browsers believe your XHTML
                    > is HTML)[/color]

                    Please pardon my ignorance but why is XHTML transitional such a bad choice?
                    [color=blue][color=green]
                    >><style type="text/css">
                    >><!--
                    >>body {[/color]
                    >
                    > ...
                    >[color=green]
                    >> background-color: #ccffff;>
                    >>}
                    >>-->
                    >></style>[/color]
                    >
                    >
                    > Hm you don't have any styles? Didn't you know that in XHTML, comments
                    > inside style block are comments?[/color]

                    More of my ignorance :-(

                    Does the same thing happen with script blocks?
                    [color=blue][color=green][color=darkred]
                    >>>How do you exactly want the font-size?[/color]
                    >>
                    >>If 100% is typically 12 point then I'm assuming/hoping that 200% is
                    >>24pt.[/color]
                    >
                    >
                    > Irrelevant.
                    >
                    >[color=green]
                    >>200% is the size I want.[/color]
                    >
                    >
                    > Why do you want 200%?[/color]

                    I don't quite follow your question? I want the font at 200% so that it's
                    twice "normal" size. Are you suggesting I use some other way to define
                    the font size?
                    [color=blue][color=green]
                    >>The text in table cells displays at 100% in IE6. In MZ it displays at
                    >>200%.[/color]
                    >
                    >
                    > IE is in quirks mode, so it is implementing old bug of not inheriting
                    > stuff on tables.
                    >
                    >[color=green]
                    >>If I change the CSS selector from "body" to "body, td" then the
                    >>text in table cells displays at 200% (which is what I want) in IE but at
                    >>400% (which I don't want) in MZ.[/color]
                    >
                    >
                    > That is because you ask it to be 400%.[/color]

                    OK so it's quirks mode that causes IE to misbehave?

                    Andrew Poulos

                    Comment

                    • Andrew Thompson

                      #11
                      Re: font sizing problem

                      On Sat, 27 Nov 2004 14:49:49 +1100, Andrew Poulos wrote:
                      [color=blue]
                      > I want ..[/color]

                      [1]
                      [color=blue]
                      > ..the font at 200% so that it's twice "normal" ...[/color]

                      [2]
                      [color=blue]
                      >...size. Are you suggesting I use some other way to define
                      > the font size?[/color]

                      [1] Any use of the term 'I want' when describing a web-page is a bad sign.

                      If you set the font size at 100%, the *user* gets the size
                      of text that the *user* wants. Simple instructions on resizing
                      the text in their browser suffice to allow the user to increase,
                      or decrease the font size at will.

                      [2] Yeah, sure! If this reasonning is followed, then every
                      web-designer who wants the page to appear prominent will quickly
                      go to %200, which then becomes the 'norm'. Are you intending to
                      go to %400 when that happens? ;-)

                      --
                      Andrew Thompson
                      http://www.PhySci.org/codes/ Web & IT Help
                      http://www.PhySci.org/ Open-source software suite
                      http://www.1point1C.org/ Science & Technology
                      http://www.LensEscapes.com/ Images that escape the mundane

                      Comment

                      • Andrew Poulos

                        #12
                        Re: font sizing problem

                        Andrew Thompson wrote:[color=blue]
                        > On Sat, 27 Nov 2004 14:49:49 +1100, Andrew Poulos wrote:
                        >
                        >[color=green]
                        >>I want ..[/color]
                        >
                        >
                        > [1]
                        >
                        >[color=green]
                        >>..the font at 200% so that it's twice "normal" ...[/color]
                        >
                        >
                        > [2]
                        >
                        >[color=green]
                        >>...size. Are you suggesting I use some other way to define
                        >>the font size?[/color]
                        >
                        >
                        > [1] Any use of the term 'I want' when describing a web-page is a bad sign.
                        >
                        > If you set the font size at 100%, the *user* gets the size
                        > of text that the *user* wants. Simple instructions on resizing
                        > the text in their browser suffice to allow the user to increase,
                        > or decrease the font size at will.[/color]

                        Would have it been better if I said "the management team that was hired
                        by the client wants" or "the usability experts evaluation reported that
                        the user wants"? I didn't mean to imply anything other than I have a
                        problem I'm required to solve, but yes "I want".
                        [color=blue]
                        > [2] Yeah, sure! If this reasonning is followed, then every
                        > web-designer who wants the page to appear prominent will quickly
                        > go to %200, which then becomes the 'norm'. Are you intending to
                        > go to %400 when that happens? ;-)[/color]

                        I understand that I'm ignorant in many areas but when doing what does
                        seem perfectly reasonable (eg. including an XML prolog or making the
                        page XHTML Transitional compliant) fails in IE - which after all is the
                        dominant browser - then I'm left to wonder what "standards-based" world
                        I've wandered into?

                        Andrew Poulos

                        Comment

                        • Andrew Thompson

                          #13
                          Re: font sizing problem

                          On Sat, 27 Nov 2004 18:01:01 +1100, Andrew Poulos wrote:
                          [color=blue]
                          > I understand that I'm ignorant in many areas but when doing what does
                          > seem perfectly reasonable (eg. including an XML prolog or making the
                          > page XHTML Transitional compliant) fails in IE - which after all is the
                          > dominant browser - then I'm left to wonder what "standards-based" world
                          > I've wandered into?[/color]

                          One in which Microsoft feels quite free to participate in the
                          development of a standard which they then ignore. One in which
                          no UA renders the standard exectly as it should.

                          You are in (shudder) 'The Real World'..

                          --
                          Andrew Thompson
                          http://www.PhySci.org/codes/ Web & IT Help
                          http://www.PhySci.org/ Open-source software suite
                          http://www.1point1C.org/ Science & Technology
                          http://www.LensEscapes.com/ Images that escape the mundane

                          Comment

                          • Lauri Raittila

                            #14
                            Re: font sizing problem

                            in comp.infosystem s.www.authoring.stylesheets, Andrew Poulos wrote:[color=blue]
                            > Andrew Thompson wrote:[/color]
                            [color=blue][color=green]
                            > > [1] Any use of the term 'I want' when describing a web-page is a bad sign.
                            > >
                            > > If you set the font size at 100%, the *user* gets the size
                            > > of text that the *user* wants. Simple instructions on resizing
                            > > the text in their browser suffice to allow the user to increase,
                            > > or decrease the font size at will.[/color]
                            >
                            > Would have it been better if I said "the management team that was hired
                            > by the client wants"[/color]

                            No
                            [color=blue]
                            > or "the usability experts evaluation reported that
                            > the user wants"?[/color]

                            Might be. Depends on situation. I don't know what you have on that table,
                            so I can't answer this question. That is why I asked.

                            First Rule of Usability? Don't Listen to Users
                            For good UX, watch what users do, not what they say. Self-reported claims and speculations about future behavior are unreliable. Users do not know what they want.

                            Let Users Control Font Size
                            Tiny text tyrannizes users by dramatically reducing task throughput. IE4 had a great UI that let users easily change font sizes; let's get this design back in the next generation of browsers.


                            But 140% or 200% for all text is guaranteed to make using your site hard.
                            Especially on low dpi machines, were IE user might already be using
                            smallest font setting, so he can't make text smaller.
                            [color=blue]
                            > I didn't mean to imply anything other than I have a
                            > problem I'm required to solve, but yes "I want".[/color]

                            The problem is that you don't tell us what problem you are trying to
                            solve. URL would tell a lot
                            [color=blue][color=green]
                            > > [2] Yeah, sure! If this reasonning is followed, then every
                            > > web-designer who wants the page to appear prominent will quickly
                            > > go to %200, which then becomes the 'norm'. Are you intending to
                            > > go to %400 when that happens? ;-)[/color]
                            >
                            > I understand that I'm ignorant in many areas but when doing what does
                            > seem perfectly reasonable fails in IE - which after all is the
                            > dominant browser - then I'm left to wonder what "standards-based" world
                            > I've wandered into?[/color]

                            The question was about your motive to use 200% (or 140%), not about
                            weather it works or not.
                            [color=blue]
                            > (eg. including an XML prolog or making the
                            > page XHTML Transitional compliant)[/color]

                            Use HTML if you don't understand XHTML. It is much betteer to do mistakes
                            using HTML than XHTML.


                            --
                            Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>

                            Comment

                            • Stephen Poley

                              #15
                              Re: font sizing problem

                              On Sat, 27 Nov 2004 14:49:49 +1100, Andrew Poulos <ap_prog@hotmai l.com>
                              wrote:
                              [color=blue]
                              >Lauri Raittila wrote:[color=green]
                              >>
                              >> You get quirks mode in IE with that doctype. Also, XHTML transitional is
                              >> very stupid choise. Use strict, and if you want it to work in IE use
                              >> HTML4 strict. (or drop xml prolog, and let browsers believe your XHTML
                              >> is HTML)[/color]
                              >
                              >Please pardon my ignorance but why is XHTML transitional such a bad choice?[/color]

                              The fact that anyone defined XHTML transitional in the first place was
                              pretty stupid. XHTML is based on XML, and presentational markup flies in
                              the face of what XML is supposed to be. Given that it exists however I
                              think that to describe using it as "very stupid" is exaggerating a
                              little.

                              The idea of "transition al" was to permit (and presumably encourage)
                              old-style HTML pages to be made standards-compliant without having to
                              rewrite them completely. There isn't really any reason to use
                              transitional for any new pages (barring one or two debatable and
                              marginal cases). And consequently not for any XHTML pages.

                              --
                              Stephen Poley


                              Comment

                              Working...