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.
Jan 29 '08 #1
3 2084
7,435 Expert 4TB
If the font is not installed on the user's computer, it cannot be used.
Jan 29 '08 #2
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>
  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
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

by: L | last post by:
Hi there, Does C# support OpenType fonts? My c# application is not recognizing OpenType fonts. Thanks, Lalasa.
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...
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...
by: Aaron Gray | last post by:
Is there anyway to get a list of all the availiable fonts in Javascript ? Aaron
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...
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....
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...
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...
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...
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...
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=()=>{
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...
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...
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 :...
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...
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...
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...
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...
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.