By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 2,069 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

Defining fonts?

P: n/a
HI:
I'm a total newby at this:

In order to have some consistency of fonts used on my web site, I wrote a ccs.
There are about 20 entries, all variations (bold; bold larger; colorerd; italic;
underlined etc) - you get the idea.

They are all using one font (Arial).

This means the phrase "Font Family: Arial;" is in each definition.

Is there a way whereby I can use a common code (such as Font Family: "font#1"
and then define this "font#1" on a separate line?

If so, could I define a number of them as "font#1, and the rest as "font#2".

That way, if I wanted to try and see what my site would loook like in a
different font, I would have to make one change only in the ccs file, rather
than about 20.

Perhaps, I'm asking for the impossible, but it's worth a try . . . .

Thanks!

John <><

A wise monkey is a monkey who doesn't monkey
with an other monkey's monkey.
Sep 1 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
John wrote:
HI: I'm a total newby at this:

In order to have some consistency of fonts used on my web site, I
wrote a ccs. There are about 20 entries, all variations (bold; bold
larger; colorerd; italic; underlined etc) - you get the idea.

They are all using one font (Arial).

This means the phrase "Font Family: Arial;" is in each definition.


body {
font-family: arial, sans-serif;
font-size: 100%; /* so users get their own preference */
}

...then delete all that stuff within your HTML. Setting your suggested
font in the CSS's body will cascade to all children of body. Don't
forget the generic fallback.

--
-bts
-This space intentionally left blank.
Sep 1 '05 #2

P: n/a
On Wed, 31 Aug 2005 20:46:46 -0400, John <no****@nospam.ca> wrote or
quoted :
That way, if I wanted to try and see what my site would loook like in a
different font, I would have to make one change only in the ccs file, rather
than about 20.


The key to this is applying a font property to a list of selectors in
one place and the other properties in another. That way you need
specify the font only once.

e.g.

..plum,.strawberry,.blackberry{ font-family: Arial, sans-serif };
..plum { font-size: 1.2 em };

..strawberry,blackberry ( color: red; }

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Sep 2 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.