Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

font question 1

Status
Not open for further replies.

skiflyer

Programmer
Sep 24, 2002
2,213
US
I have a site, dynamically generated, lots of table cells, lots of forms, and a few pages.

Now, it's been requested I set the font to something else.

What's the easiest way to go about this? I really can't imagine it's the <font> tag, and I'm completely unfamilar with how to use CSS, though from my research I'm thinking this may be the way? But everything I can find seems like too much since I just want this universally applied as the font face throughout the page, without overwriting my <font> tags which deal with size and such.

-Rob
 
Just add this to your <head>:

<style>
body{
font-family:&quot;arial&quot;;
}
</style>

If that doean't work, take off the quotes.

Rick -----------------------------------------------------------
 
skiflyer

Just an as addition to Ristmo's post, you should seriously consider removing all font tags and just using css. This saves a lot of time and effort when updating the site.

Hope this helps Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Definitely CSS. I haven't used a font tag in years.
 
Thanks for all the links, and the help. I'll look into that, right now my font tags don't do anything except change sizes... bold and such I do with <b><i><etc..> tags.

Even with such settings would you maintain that advice?

-Rob
 
Ok I don't get this at all... I did what Ristmo said, and that worked fine.... now I'm asked to make the font a little smaller, and I get no response from the font-size attribute...

I've tried..

body{
font-family:&quot;arial&quot;;
font-size:&quot;50%&quot;;
}

as well as...
font-size:&quot;small&quot;;
font-size:&quot;large&quot;;
font-size:&quot;11px&quot;;
font-size:.7em;

I've tried leaving and dropping the arial part as well as changing it to Verdana.

No matter what I do, the size never changes... the font itself goes between whatever this default is, to arial, to verdana... but whatever size it chooses... it sticks with, any ideas?

-Rob
 
take the size out of &quot; &quot;
body{
font-family:&quot;arial&quot;;
font-size:11px;
}
---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
actually take everything out of quotes. ---------------------------------------
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
No difference... I added in the color tag, that also looks fine... just can't mess with the size....

-Rob
 
and in the cases where there aren't any?

Can the page have no font tags for this to work?

-Rob
 
did you try one of these:

font-size:11pt; (instead of px)
font-size:small; (no quote's)

or set the complete font:

font:11pt arial;

hope this helps,
Erik <-- My sport: Boomerang throwing !!
!! Many Happy Returns !! -->
 
Thanks for all the suggestions, we were all wrong, because I didn't give enough information... sorry.

Here's the deal.

If you have tables in your body, the font face and font color carry into the table cells, the font sizes do not, so I had to add

table {
font-face: arial;
font-size: 11pt;
color: black
}

and all was good

(I actually moved it out to a .css file and am starting to learn these, you folks are very right about how much easier these are.)

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top