472,992 Members | 3,662 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,992 software developers and data experts.

how to use different fonts in css

hi there,
im having trouble in using different kind of font, well not really trouble, its just i dont know how to link the font i want to using. its not the default font that we use in html.
could you give me some example of that? or is it possible to do that?
have a great day , thanks
if there is any possibility please e-mail me..
xxxx@gmail.com.. or reply to my post.
thanks
Jan 29 '08 #1
3 2084
drhowarddrfine
7,435 Expert 4TB
If the font is not installed on the user's computer, it cannot be used.
Jan 29 '08 #2
harshmaul
490 Expert 256MB
you can change the font a number of ways. look at this simple example....

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <title>Page Title</title>
  6. <style type="text/css">
  7. body{
  8. /*this will change the font of the entire BODY to verdana*/
  9. font-family:Verdana;
  10. }
  11. p{
  12. /*this will change each "p" tag to be arial*/
  13. font-family:arial;
  14. }
  15. .myClass{
  16. /*this will change each element with a class attribute as "myClass" to tahoma*/
  17. font-family:tahoma;
  18. }
  19. #myID{
  20. /*this will change the element with an ID of "myID" to Courier new*/
  21. font-family:Courier New;
  22. }
  23. </style>
  24.  
  25. </head>
  26. <body>
  27. <div>
  28.     <span>This font is verdana</span>
  29.     <p>This font is arial</p>
  30.     <span class="myClass">This font is tahoma</span>
  31.     <span id="myID">This font is Courier</span>
  32. </div>
  33. </body>
  34. </html>
Jan 29 '08 #3
drhowarddrfine
7,435 Expert 4TB
Oops. Yes. I read "default font" meaning a font normally installed on computers, as in "custom font".
Jan 29 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: L | last post by:
Hi there, Does C# support OpenType fonts? My c# application is not recognizing OpenType fonts. Thanks, Lalasa.
4
by: Bob | last post by:
I thought if I specified Veranda 10 in my application that, if Windows was English language, the font would be the same everywhere. But I just saw a screenshot of my application from a site in the...
2
by: anil | last post by:
If any body knows how to include and use fonts in C program..please let me know,,since I was doing 'Character recognition' for hindi I dont know how to link those fonts to my program.. --anil...
4
by: Aaron Gray | last post by:
Is there anyway to get a list of all the availiable fonts in Javascript ? Aaron
2
by: Luc | last post by:
I saw a few posts on this newsgroup about it but nothing to help me resolve this problem: We designed a window in .NET on a platform using small fonts (120 ppp). But this window will run on...
1
by: Atul | last post by:
Hi, I have installed a truetype font (.ttf) on a linux machne (SUSE linux 10, KDE) by copying it to my .fonts folder. I can use the font in all applications like open-office and firefox browser....
12
by: ctclibby | last post by:
Hi all Have a customer that wants a specific font included in her web page design; Comic Sans MS. This is one of the MS core fonts. The problem I have is that some of the *nix browsers do NOT...
70
by: axlq | last post by:
I'm trying to design my style sheets such that my pages have similar-looking fonts different platforms (Linux, Mac, Adobe, X-Windows, MS Windows, etc). The problem is, a font on one platform...
3
by: Ryan Liu | last post by:
Hi, I have a big urgent problem to solve. I used to use Windows 2000 Chinese version, now I installed Windows XP (English) system. The problem is not about 2000 or XP, it is about English...
53
by: Jonas Smithson | last post by:
In his book "CSS: The Definitive Guide" 2nd edition (pgs. 116-117), Eric Meyer has an interesting discussion about "font-size-adjust" that was evidently dropped in CSS 2.1 due to browser...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.