Why does font-style not work when used in the <BODY> tag?

Discussion in 'HTML' started by Joshua Beall, Oct 29, 2003.

  1. Joshua Beall

    Joshua Beall Guest

    I am trying to make all the text on some of my pages smaller using CSS.
    What I did was put an inline style setting in the <BODY> tag, as follows:

    <body STYLE="font-family: Arial, Helvetica, Sans Serif; font-size:
    smaller">

    Now, the "font-family" portion works just fine; all my text is Arial,
    instead of my system default (Times New Roman). However, no matter what I
    set "font-size" to, the font size is unaffected. I have tried smaller,
    small, x-small, and xx-smaller. Nothing works.

    Obviously I am not doing something right. Can someone enlighten me?

    -Josh
    Joshua Beall, Oct 29, 2003
    #1
    1. Advertising

  2. Joshua Beall

    rf Guest

    "Joshua Beall" <> wrote in message
    news:iKEnb.1339$...
    > I am trying to make all the text on some of my pages smaller using CSS.


    Why? Why not just use the user settings in your browser to make the text
    smaller. That way the text will be "normal" size for everybody else.

    > What I did was put an inline style setting in the <BODY> tag, as follows:
    >
    > <body STYLE="font-family: Arial, Helvetica, Sans Serif; font-size:
    > smaller">
    >
    > Now, the "font-family" portion works just fine; all my text is Arial,
    > instead of my system default (Times New Roman). However, no matter what I
    > set "font-size" to, the font size is unaffected. I have tried smaller,
    > small, x-small, and xx-smaller. Nothing works.


    A wild guess: You have also used tables to layout your page. Some browsers
    do not inherit font size into table cells correctly. Use:

    body, td {...}

    and don't use those things, use percentages and nothing below 100 of them
    except perhaps for a copyright notice which you want to make unreadable.

    Cheers
    Richard.
    rf, Oct 29, 2003
    #2
    1. Advertising

  3. Joshua Beall

    Paul Aitch Guest

    "Joshua Beall" <> wrote in message
    news:iKEnb.1339$...
    > I am trying to make all the text on some of my pages smaller using

    CSS.
    > What I did was put an inline style setting in the <BODY> tag, as

    follows:
    >
    > <body STYLE="font-family: Arial, Helvetica, Sans Serif; font-size:
    > smaller">
    >
    > Now, the "font-family" portion works just fine; all my text is Arial,
    > instead of my system default (Times New Roman). However, no matter

    what I
    > set "font-size" to, the font size is unaffected. I have tried

    smaller,
    > small, x-small, and xx-smaller. Nothing works.
    >
    > Obviously I am not doing something right. Can someone enlighten me?
    >
    > -Josh
    >

    Have you tried specifying an actual size in pixcels? e.g.:
    .......font-size:20px;

    Paul
    Paul Aitch, Oct 29, 2003
    #3
  4. Paul Aitch wrote:

    > Have you tried specifying an actual size in pixcels? e.g.:
    > ......font-size:20px;


    Argh. Dear. Me. Please. No.

    I'm yet to see a browser which actually gets pixels right (in CSS terms),
    and preventing a user from resizing their text (OK OK, its their own fault
    for using Microsoft's excuse for a browser, but lots of people make that
    mistake) isn't a good idea.

    --
    David Dorward http://dorward.me.uk/
    David Dorward, Oct 29, 2003
    #4
  5. Joshua Beall

    Sid Ismail Guest

    On Wed, 29 Oct 2003 01:29:50 GMT, "Joshua Beall" <> wrote:

    : <body STYLE="font-family: Arial, Helvetica, Sans Serif; font-size:
    : smaller">
    :
    : Now, the "font-family" portion works just fine; all my text is Arial,
    : instead of my system default (Times New Roman). However, no matter what I
    : set "font-size" to, the font size is unaffected. I have tried smaller,
    : small, x-small, and xx-smaller. Nothing works.
    :
    : Obviously I am not doing something right. Can someone enlighten me?


    Have you got tables? then you need to specify
    body, td {... }

    Problem with inheritance.

    URL?

    Sid
    Sid Ismail, Oct 29, 2003
    #5
  6. Joshua Beall

    David Graham Guest

    "Joshua Beall" <> wrote in message
    news:iKEnb.1339$...
    > I am trying to make all the text on some of my pages smaller using CSS.
    > What I did was put an inline style setting in the <BODY> tag, as follows:
    >
    > <body STYLE="font-family: Arial, Helvetica, Sans Serif; font-size:
    > smaller">
    >
    > Now, the "font-family" portion works just fine; all my text is Arial,
    > instead of my system default (Times New Roman). However, no matter what I
    > set "font-size" to, the font size is unaffected. I have tried smaller,
    > small, x-small, and xx-smaller. Nothing works.
    >
    > Obviously I am not doing something right. Can someone enlighten me?
    >
    > -Josh

    Hi
    Is that a comma after Sans Serif?
    It should be a semi-colon
    HTH
    David
    David Graham, Oct 29, 2003
    #6
  7. Joshua Beall

    Joshua Beall Guest

    "rf" <> wrote in message
    news:AKFnb.169218$...
    > Some browsers do not inherit font size into table cells correctly.


    Is this a bug, or does the W3C spec make this an acceptable behaviour?

    -jb
    Joshua Beall, Oct 29, 2003
    #7
  8. Joshua Beall

    Adrienne Guest

    Gazing into my crystal ball I observed "Joshua Beall" <>
    writing in news:5ePnb.27581$:

    > "rf" <> wrote in message
    > news:AKFnb.169218$...
    >> Some browsers do not inherit font size into table cells correctly.

    >
    > Is this a bug, or does the W3C spec make this an acceptable behaviour?
    >
    > -jb
    >
    >
    >


    The W3C makes recommendations only.

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
    Adrienne, Oct 29, 2003
    #8
  9. Joshua Beall wrote:

    > "rf" <> wrote in message
    > news:AKFnb.169218$...
    >> Some browsers do not inherit font size into table cells correctly.

    >
    > Is this a bug, or does the W3C spec make this an acceptable behaviour?


    Bug.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
    Toby A Inkster, Oct 29, 2003
    #9
  10. Joshua Beall wrote:

    > <body STYLE="font-family: Arial, Helvetica, Sans Serif; font-size:
    > smaller">


    Note: Sans Serif should be "Sans Serif". You're not allowed to use font
    names with spaces in them, unless you put quote marks around them.

    Or perhaps you meant sans-serif (lower case, with a hyphen) which requests
    that the browser uses its default sans serif font.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
    Toby A Inkster, Oct 29, 2003
    #10
  11. "Joshua Beall" <> wrote:

    > "rf" <> wrote in message
    > news:AKFnb.169218$...
    >> Some browsers do not inherit font size into table cells correctly.

    >
    > Is this a bug, or does the W3C spec make this an acceptable behaviour?


    Good question. In principle, there's nothing in the specs that prevents a
    browser from having a browser style sheet like
    table { font-size: 10.5pt; }
    and then there will be no font size inheritance into tables, since
    inheritance is _only_ applied when _no_ style sheet specifies the value of a
    property of an element.

    In practical terms though, it's a bug, albeit maybe intentional.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Oct 30, 2003
    #11
  12. Toby A Inkster <> wrote:

    > Note: Sans Serif should be "Sans Serif". You're not allowed to use font
    > names with spaces in them, unless you put quote marks around them.


    It's time for my weekly nitpicking:

    "Font family names containing whitespace should be quoted. If quoting is
    omitted, any whitespace characters before and after the font name are
    ignored and any sequence of whitespace characters inside the font name is
    converted to a single space."
    http://www.w3.org/TR/REC-CSS2/fonts.html#propdef-font-family

    So it's indeed "should", not "shall", and we _are_ allowed to use font names
    with spaces in them without putting quotation marks around them - though
    this is not good practice. It's easier to see the structure of a declaration
    when such names are quoted.

    And there is currently no such font as "Sans Serif". Anyone and his brother
    is allowed to create one, of course. That name wouldn't be a good choice,
    though, due to confusion. And you probably couldn't use it as a trademark,
    since it resembles a generic expression too much.

    > Or perhaps you meant sans-serif (lower case, with a hyphen) which requests
    > that the browser uses its default sans serif font.


    The generic font family name sans-serif (which _must not_ be put into
    quotation marks) is a CSS keyword, and CSS keywords are case insensitive:

    "All CSS style sheets are case-insensitive, except for parts that are not
    under the control of CSS."
    http://www.w3.org/TR/REC-CSS2/syndata.html#q4

    Specific font names, such as "Times New Roman", are considered as not being
    under the control of CSS, since they are defined by font designers and by
    implementations (and implementations _may_ treat "times new roman" as
    another name for "Times New Roman"). Thus they are in principle case
    sensitive, though I wonder whether this matters in practice. Anyway, font
    manufacturers' common practice is to name the fonts so that all words begin
    with a capital letter and other letters are lowercase, so it's usually easy
    to use the right case.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Oct 30, 2003
    #12
  13. Joshua Beall

    Safalra Guest

    Adrienne <> wrote in message news:<Xns94235740D5365arbpenyahoocom@207.115.63.158>...
    > The W3C makes recommendations only.


    Really? They call themselves "the global standard-setting body for the
    Web":

    http://www.w3.org/2003/10/28-906-briefing

    Of course standards are rarely legally binding, so I suppose all
    standards are recommendations in reality...

    --- Stephen Morley ---
    http://www.safalra.com
    Safalra, Oct 30, 2003
    #13
  14. (Safalra) wrote:

    >> The W3C makes recommendations only.

    >
    > Really? They call themselves "the global standard-setting body for the
    > Web"


    They use the word "standard" in a non-standard way, calling themselves even
    a "standards body" (though not absolutely directly) at
    http://www.w3.org/Consortium/

    Recognized international standardization bodies are listed at
    http://www.wssn.net/WSSN/listings/links_international.html

    > Of course standards are rarely legally binding, so I suppose all
    > standards are recommendations in reality..


    Yes, but not all recommendations are standards.

    And W3C recommendations would not actually qualify as standards - standards
    are far more definite and fixed, not moving targets like W3C
    recommendations, which may change at any moment (without prior or posterior
    notice) simply by a change to an "Errata" document.

    ObHTML: There is an ISO standard for HTML. Virtually nobody uses it, partly
    because it was produced in a rather unconstructive way: they took HTML 4.0
    Strict and made it stricter, without actually resolving any of the
    ambiguities and obscurities in the W3C recommendation that would have needed
    some attention.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Oct 30, 2003
    #14
  15. Joshua Beall

    C A Upsdell Guest

    "Safalra" <> wrote in message
    news:...
    > Adrienne <> wrote in message

    news:<Xns94235740D5365arbpenyahoocom@207.115.63.158>...
    > > The W3C makes recommendations only.

    >
    > Really? They call themselves "the global standard-setting body for the
    > Web":
    >
    > http://www.w3.org/2003/10/28-906-briefing
    >
    > Of course standards are rarely legally binding, so I suppose all
    > standards are recommendations in reality...


    Perhaps 'recommended standards'?
    C A Upsdell, Oct 30, 2003
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2FsdmluIEtE?=

    <body onload="alert('Hello');"> does not work! Why?

    =?Utf-8?B?Q2FsdmluIEtE?=, Aug 25, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    10,458
    =?Utf-8?B?Q2FsdmluIEtE?=
    Aug 29, 2005
  2. shruds
    Replies:
    1
    Views:
    788
    John C. Bollinger
    Jan 27, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,844
    Smokey Grindel
    Dec 2, 2006
  4. =?Utf-8?B?dG9t?=

    font-size of body style-rule does not work

    =?Utf-8?B?dG9t?=, Feb 22, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    556
    =?Utf-8?B?dG9t?=
    Feb 23, 2007
  5. mttc
    Replies:
    2
    Views:
    2,387
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page