computer help index
 
 
Search:
"Offering free computer help, hints, and tips to the Internet populace." Now with over 3,240 tips!

Web Development - Fonts

Tired of Adding FONT Tags Between Paragraphs?

Here's the scenario: You have five paragraphs on a webpage. You want the text in those five paragraphs to use a certain font, let's say Arial. The problem is that every time you make a new paragraph, you have to close the <FONT> tag before you can use the <P> tag. Then, you have to create a new <FONT FACE="arial"> tag for the next paragraph. Before you can do another paragraph break, you have to use another </FONT> tag.

This can get old very quick.

There are a couple of very sneaky ways to get around this trick. One is to use the <BASEFONT="arial"> tag near the top of your document. With some browsers, this will force all of the text on the webpage to use Arial as the default font.

The second trick is to use a WYSIMWYG (What You See Is Maybe What You Get(!)) web editor and use pulldown menus and such to define fonts.

The last trick, one I personally use, is to forget the <P> tag when defining paragraph breaks. Instead, I use a <BR> tag, an ampersand character, the letters 'nbsp', a semicolon, and another <BR> tag. This 'simulates' a paragraph break, but it does not force you to close the previous paragraph's <FONT> tag. This tip may not be recommended by some HTML experts, so I am leaving the implementation up for you to decide.

(I bet a lot of you are saying "Andrew, why all those weird characters between the two <BR> tags?" Some browsers, including Netscape, will not render two <BR> tags correctly. They render multiple <BR> tags as if you only put in one <BR> tag. Thus, there would not be a space between your 'paragraphs.' The characters I mentioned above are the HTML code for a non-breaking space. This makes Netscape and other such browsers think there is really some text between the two <BR> tags, and it will render your pseudo-paragraph break correctly. And before you ask, no you can not just put a space between both <BR> tags - you must use the non-breaking space. Sorry.


 
Add: Del.icio.us | Digg | Furl | My Yahoo!
 
Discuss This Tip

Print This Tip

Get E-Mail When New Tips are Online

Return to the Web Development - Fonts page.

RSS Feeds - Subscribe!
 

You want the latest tech tips and tricks in your e-mail Inbox - FREE? Type your e-mail address below and click 'Subscribe'.
 



( sample / details ) ( opt-out instructions )
 


 Free Offer! - Subscribe to the MalekTips computer help list and be one of the first to get new computer tips, articles, and download links! ( privacy policy )  ( opt-out instructions )
This page and its contents are copyright
©1997 - 2008 Envision Programming. ( copyright/disclaimer )

Home | Free Computer Help Newsletter! | Windows | Web Development | DOS and Batch Files | Removing Spyware
Digital Camera and Photography | Computer and Internet | Software | Microsoft Word
Computer Articles | About | Contribute a Tip | Link To Us! | Computer and Technology Links
RSS Feeds |  Contact Us | Advertising | Privacy Policy | Computer Help Forums