fontclass in body style

Discussion in 'HTML' started by Frank, Oct 6, 2003.

  1. Frank

    Frank Guest

    Hello,

    my external style file looks like below. How can I link class 'lettertimes'
    to the 'body' in this style sheet. As I have done below doesn't work.

    Thanks

    Frank

    <style>
    <!--
    ..lettertimes {font-family: times new roman; font-size: 1em;}
    ..lettertimesb {font-family: times new roman; font-size: 1em;
    font-weight=bold;}
    ..lettertimes15 {font-family: times new roman; font-size: 1.5em;}
    body {
    background-image: url(backg.gif);
    lettertimes;
    }

    -->
    </style>
     
    Frank, Oct 6, 2003
    #1
    1. Advertising

  2. Frank

    Steve Pugh Guest

    "Frank" <> wrote:

    >my external style file looks like below. How can I link class 'lettertimes'
    >to the 'body' in this style sheet. As I have done below doesn't work.



    If this is your external style sheet (i.e. the contents of a .css
    file) then you must remove the HTML <style> tags and the HTML comment
    tags - these have no place in a CSS file.

    ><style>
    ><!--
    >.lettertimes {font-family: times new roman; font-size: 1em;}
    >.lettertimesb {font-family: times new roman; font-size: 1em;
    >font-weight=bold;}


    That = should be :

    >.lettertimes15 {font-family: times new roman; font-size: 1.5em;}
    >body {
    >background-image: url(backg.gif);
    >lettertimes;
    >}
    >
    >-->
    ></style>


    Either, add class="lettertimes" to your body tag in your HTML files.
    Or copy the styles from .lettertimes into your body selector.
    e.g.
    body {
    font-family: times new roman; font-size: 1em
    background-image: url(backg.gif);
    }

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Oct 6, 2003
    #2
    1. Advertising

  3. Frank

    Frank Guest

    Thanks Steve, I expected that I wasn't allowed to use a class in the body in
    thee style file. Thanks for the other remarks.
    What I actually want is this:
    body { font-family: times new roman; font-size: 1em, font-family: helvetica;
    font-size: 1em}
    So if times isn't available then helvetica must be used. But are the size
    and other attributes properly used by the browser?

    Thanx

    Frank

    "Steve Pugh" <> wrote in message
    news:...
    > "Frank" <> wrote:
    >
    > >my external style file looks like below. How can I link class

    'lettertimes'
    > >to the 'body' in this style sheet. As I have done below doesn't work.

    >
    >
    > If this is your external style sheet (i.e. the contents of a .css
    > file) then you must remove the HTML <style> tags and the HTML comment
    > tags - these have no place in a CSS file.
    >
    > ><style>
    > ><!--
    > >.lettertimes {font-family: times new roman; font-size: 1em;}
    > >.lettertimesb {font-family: times new roman; font-size: 1em;
    > >font-weight=bold;}

    >
    > That = should be :
    >
    > >.lettertimes15 {font-family: times new roman; font-size: 1.5em;}
    > >body {
    > >background-image: url(backg.gif);
    > >lettertimes;
    > >}
    > >
    > >-->
    > ></style>

    >
    > Either, add class="lettertimes" to your body tag in your HTML files.
    > Or copy the styles from .lettertimes into your body selector.
    > e.g.
    > body {
    > font-family: times new roman; font-size: 1em
    > background-image: url(backg.gif);
    > }
    >
    > Steve
    >
    > --
    > "My theories appal you, my heresies outrage you,
    > I never answer letters and you don't like my tie." - The Doctor
    >
    > Steve Pugh <> <http://steve.pugh.net/>
     
    Frank, Oct 6, 2003
    #3
  4. Frank

    Steve Pugh Guest

    "Frank" <> wrote:

    >Thanks Steve, I expected that I wasn't allowed to use a class in the body in
    >thee style file. Thanks for the other remarks.
    >What I actually want is this:
    >body { font-family: times new roman; font-size: 1em, font-family: helvetica;
    >font-size: 1em}
    >So if times isn't available then helvetica must be used. But are the size
    >and other attributes properly used by the browser?


    font-family: "Times New Roman", Helvetica;

    If the font name contains a space then it is a very good idea to quote
    it. If you want to specify a series of fallback fonts then just
    include them in order of preference, separated by commas.

    Helvetica is a sans-serif font, and thus is an odd second choice to
    TNR, a serif font.

    Please don't top post.

    You specify the font-size once, nor matter how many fonts there are in
    the font-family list. There's no way to specify different sizes for
    different fonts in the list (there is a property called
    font-size-adjust but it isn't supported by browsers).

    Specifying 1em for body is pointless as that's the default.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Oct 6, 2003
    #4
    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. Progman

    body.style?

    Progman, Mar 4, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    689
    Terry Burns
    Mar 4, 2006
  2. Joshua Beall
    Replies:
    14
    Views:
    13,608
    C A Upsdell
    Oct 30, 2003
  3. Ken Varn
    Replies:
    0
    Views:
    503
    Ken Varn
    Apr 26, 2004
  4. London Boy
    Replies:
    2
    Views:
    349
    Keith Bowes
    Jan 12, 2004
  5. Replies:
    5
    Views:
    231
    A. Sinan Unur
    Sep 8, 2005
Loading...

Share This Page