fontclass in body style

F

Frank

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>
 
S

Steve Pugh

Frank said:
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
<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
 
F

Frank

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
 
S

Steve Pugh

Frank said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top