set the default font with css?

Help with html/xhtml, css, javascript and other related topics.

Moderator: Moderators

set the default font with css?

Postby DJ-PRIME90 on Sat Apr 01, 2006 1:34 pm

How do I set a default font using CSS?
DJ-PRIME90
Registered User
Registered User
 
Posts: 158
Joined: Sun May 30, 2004 9:08 pm
Location: Montreal, Canada

Postby UseLess on Sat Apr 01, 2006 1:44 pm

Greetings,

Exactly what do you mean by default?

As a font you have on your machine may not be on someone elses.

But you set a font with:
Code: Select all
font-family: Arial;

or
Code: Select all
font-family: Tahoma, Verdana, Arial;


which will use Tahoma if it's present, if not it'll use Verdana if that font is present and failing that it'll use Arial.

I think ...
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby DJ-PRIME90 on Sat Apr 01, 2006 1:52 pm

This what I have now:
Code: Select all
.toplinks {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:16px;
font-weight:bold;
}


As you can see that style has a name. But to use that font, I have to put:
Code: Select all
<span class="toplinks"></span>
or
add class="toplinks" to my tables

just to use that style.

But I want to know how to set a font that will appear without having to put those tags in.
DJ-PRIME90
Registered User
Registered User
 
Posts: 158
Joined: Sun May 30, 2004 9:08 pm
Location: Montreal, Canada

Postby Isi on Sat Apr 01, 2006 2:55 pm

Simply

Code: Select all
html,body { 
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:16px;
font-weight:bold;
}
You are the one, [username]!
Isi
Registered User
Registered User
 
Posts: 87
Joined: Fri Jan 21, 2005 1:44 pm

Postby DJ-PRIME90 on Sat Apr 01, 2006 3:00 pm

thanks
DJ-PRIME90
Registered User
Registered User
 
Posts: 158
Joined: Sun May 30, 2004 9:08 pm
Location: Montreal, Canada


Return to (X)HTML Coding

Who is online

Users browsing this forum: No registered users and 2 guests

cron