Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

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

 
Thread Tools Search this Thread
Old 10-29-2003, 01:29 AM   #1
Default Why does font-style not work when used in the <BODY> tag?


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
  Reply With Quote
Old 10-29-2003, 02:38 AM   #2
rf
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?


"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.


  Reply With Quote
Old 10-29-2003, 06:58 AM   #3
Paul Aitch
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?


"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


  Reply With Quote
Old 10-29-2003, 08:06 AM   #4
David Dorward
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?

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/
  Reply With Quote
Old 10-29-2003, 10:33 AM   #5
Sid Ismail
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?

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

  Reply With Quote
Old 10-29-2003, 12:28 PM   #6
David Graham
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?


"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


  Reply With Quote
Old 10-29-2003, 01:26 PM   #7
Joshua Beall
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?

"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


  Reply With Quote
Old 10-29-2003, 04:34 PM   #8
Adrienne
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?

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
  Reply With Quote
Old 10-29-2003, 06:33 PM   #9
Toby A Inkster
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?

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

  Reply With Quote
Old 10-29-2003, 06:35 PM   #10
Toby A Inkster
 
Posts: n/a
Default Re: Why does font-style not work when used in the <BODY> tag?

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

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump