Go Back   PCMech Forums > Help & Discussion > Internet, Web Applications, & The Cloud

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 12-07-2001, 02:36 AM   #1
Member (10 bit)
 
Join Date: Mar 1999
Location: Zurich, Switzerland
Posts: 797
How to customize font style in a web page?

Hi there,

in a web page, ususally Times (aka TimesNewRoman) is the default font.

How can I set the font for my page to, say, Arial?

I can do it for a single cell in a table or for a text snippet, using the font face tag: < font face = "Arial" > Text Snippet < /font >

When I put the font face tag right inside the body and /body tags, the text style of the whole page flips to Arial only when viewing with IE. It doesn't work with Netscape. How can I make it work also with Netscape?

Any help is highly appreciated. Thanx
Felix is offline   Reply With Quote
Old 12-07-2001, 06:16 AM   #2
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Using font tags is not the way to go. As you can see, the font face only works in IE, Opera and I think NS 6. The best way to do so is to use a stylesheet. You have great control with stylesheets. You have 3 options with stylesheets. You have an internal stylesheet, an imported stylesheet, and a linked stylesheet. Personal preference is to use a linked stylesheet, since you can make global changes to your site this way. Basically you can control the way your hyperlinks, paragraphs, table cells, headers, etc look.

There are a couple of good ways to learn how to use stylesheets. I mostly learned by looking at other stylesheets that were in my cache. These are external stylesheets with a .css extension. They are referenced in a web page like this in the head section:
<LINK rel="STYLESHEET" type="text/css" href="stylesheetname.css">

So if you wanted to control the font and layout of your paragraph your would have something like this:
P { font-family: verdana, helvetica, arial, geneva, lucida, sans-serif; color:#000000; font-size:12px; text-indent:24px }
This says that any time you use the <P> tag, it will first look for the verdana font, if not found, then helevetica, etc. You also specify the color, size and in this case, I use a text-indent. I prefer to specify the font size in pixels rather than points since it looks better.

You can also create classes in stylesheets like this:
P.red { font-family: verdana, helvetica, arial, geneva, lucida, sans-serif; color:#FF0000; font-size:12px}
What this does is that any time you use this:
<P class="red"> , you will have a red 12px font with no text indent.

If you notice, each section is enclosed by {} and each division within those brackets is separated by ; .

That is basically how stylesheets work. For more info check theses sites:
Glish
W3c.org

You can also download a free stylesheet editor here . All you need is a text editor but this can help out with some of the obscure tags.

Anyway, I can email you a stylesheet example with the page that it is linked to if you want.
__________________

Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row

Last edited by mairving; 12-07-2001 at 06:18 AM.
mairving is offline   Reply With Quote
Old 12-07-2001, 09:05 AM   #3
Member (10 bit)
 
Join Date: Mar 1999
Location: Zurich, Switzerland
Posts: 797
thank you mairving, great tutoruial and great links! I've fiddled a bit "quick and dirty" with one page and it seems to work. That's fine for the moment, while I'll stay with the table layout, while CSS has the potential also to handle this... maybe in the future, when we've got rid of the Netscape 4.7 at work.

thanx again!
Felix is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:56 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2