default font

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
toppac
Forum Commoner
Posts: 29
Joined: Fri Jun 14, 2002 10:44 am

default font

Post by toppac »

How do you set the default font in the BODY tag? I cant seem to remember
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Do it in CSS:

Code: Select all

BODY {font-family: arial, helvetica, sans-serif;}
Mac
nobody
Forum Newbie
Posts: 1
Joined: Fri Jun 21, 2002 5:39 am
Location: Brasil
Contact:

Post by nobody »

it's easy...

<body font-family=verdana tahoma size=10 color=#000080>

nobody
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

nobody wrote:<body font-family=verdana tahoma size=10 color=#000080>
font-family is CSS not HTML and color and size aren't valid attributes for the body tag therefore the above example won't work. Using CSS the above would look like this:

Code: Select all

BODY &#123;
    font-family: verdana, tahoma;
    font-size: 10pt;
    color: #000080;
&#125;
Mac
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

Also in HTML any attributes that are not entirely numeric should have quotes around them.
will
Forum Contributor
Posts: 120
Joined: Fri Jun 21, 2002 9:38 am
Location: Memphis, TN

Post by will »

you could do it in straight HTML, but with the power of CSS, i'm not sure why you'd want to....

Code: Select all

<basefont face="fontname">
Post Reply