|
|||
|
|
CONTENTS
Text ExtensionsThe <FONT>TagThe <FONT> tag adjusts the font, color and size of any text placed between <FONT> and its corresponding end tag, </FONT>. Here's how it works: <FONT FACE="[face]" SIZE="[size]" COLOR="[color]">Affected text goes here</FONT>
Example: <HTML> The <BASEFONT> TagAs mentioned above that the standard font size in a document is 3. This is called the base font, and it's not set in stone. To change it (and to chage the type of font used), use the <BASEFONT> tag: <BASEFONT FACE=size SIZE=size> Once again, size is a number between 1 and 7 that specifies the base font size you want. For example, if you enter <BASEFONT=7> at the top of your document (the top of the body section, that is), then all the text will appear with font size 7. You may be wondering what the heck's the big deal with <BASEFONT>. After all, couldn't you just insert a <FONT SIZE=7> tag at the top of the document? Good point. (Gee, you are paying attention, aren't you?) The beauty (if beauty is the right term) of base fonts is that they enable you to set up relative font sizes. A relative font size is one that's so many sizes larger or smaller than the base font. Here's an example: <BASEFONT=6> The <FONT SIZE=-2> tag tells your browser to display the text in a font size that's two sizes smaller than the base font (to get larger fonts, you'd use a plus sign (+), instead). Since we specified a base font of 6, the text up to the </FONT> tag appears with a font size of 4. Why not simply use <FONT SIZE=4>, instead? Well, suppose you plaster your document with dozens of font changes and then, when you display it in your browser, the fonts look too small. If you're using explicit font sizes, you have to painstakingly adjust each <FONT> tag. However, if you're using relative font sizes, you only have to change the <BASEFONT> tag. Changing the Color of Your Page TextBrowsers display your text in basic black, which is readable but not all that exciting. To put some color in your text's cheeks, the <BODY> tag helps you: <BODY TEXT="#xxxxxx"> The xxxxxx part is a number that specifies the color you want to use. (Note, however, that colored text looks best on a background other than the normal, boring gray. We'll show you how to change the background color later in this chapter.) The following table lists the appropriate values for some common colors: (Appendix IV contains full table lists.)
List ExtensionsIf you're planning to use a lot of numbered lists or bulleted lists, There're a couple of simple enhancements that can give your pages some variety. To wit, you can specify an alternative numbering scheme in a numbered list, and you can specify a different type of bullet in a bulleted list. Using a Different Numbering Scheme in Numbered ListsAs you learned back in Chapter 6 you enclose a numbered list with the <OL> and </OL> tags, and use <LI> at the beginning of each item. For each <LI> tag, the browser includes a number to the left of the item, where the first item is 1, the second is 2, and so on. There is an extension to the <OL> tag that enables you to define a different numbering scheme. Here's how it works: <OL TYPE=type> Here, type is one of the following characters:
Here's an example: <HTML> Changing the Bullet Type in Bulleted ListsYour browser's basic bulleted-list bullet is a small circle. The best way to get a better bullet is to use an <IMG> tag that references some cool bullet-like image. (how to do this in Chapter 8.) If you prefer to leave graphics out of it, <UL> tag for bulleted lists has an extra TYPE attribute: <UL TYPE=type> In this case, type can be either disc (the standard bullet), circle, or square. Here's a for-instance: <HTML> Graphics ExtensionsYou saw back in Chapter 8 how a few well-chosen graphics can do wonders for your pages. There're some extra graphics goodies that can help your images display faster and can enhance the overall look of your page. The next two sections tell all. Specifying Image Height and WidthWhen surfing Web sites that contain graphics, have you ever wondered why it sometimes takes quite a while before anything appears on the screen? Well, one of the biggest delays is that most browsers won't display the entire page until they've calculated the height and width of all the images. "What if there was some way to tell the browser the size of each image in advance? The browser wouldn't have to worry about it and things would show up on-screen much faster." For that there is <IMG> tag: the HEIGHT and WIDTH attributes: <IMG SRC="filename" WIDTH=x HEIGHT=y> Here, filename is the name of the graphics file, x is the width of the graphic, and y is its height. Both dimensions are measured in pixels (which is short for picture elements), which are the tiny dots that make up the picture on your screen. Alternatively, you can express the width and height as percentages of the screen. For example, the following line displays the image bluebar.gif so its width always takes up 90 percent of the screen: <IMG SRC="bluebar.gif" WIDTH=90%> The advantage here is that, no matter what size screen someone is using, the graphic will always take up the same amount of room across the screen. (Note, that since we didn't specify the HEIGHT, your browser adjusts the height in proportion to the increase or decrease of the width.). Setting the BackgroundWhen it appears in a browser, your Web page text and graphics float in a sea of dull, drab gray. It's about as exciting as a yawning festival. One of the most welcome extensions is the ability to change the background color your page appears on to whatever suits your style. The guts of your page appears within the body, so it makes sense that this extension is part of the <BODY> tag: <BODY BGCOLOR="#xxxxxx"> Yes, the xxxxxx part is the same as what you saw earlier in this chapter.
Instead of a color, you may also specify an image to use as the background (similar to the way Windows lets you cover the desktop with wallpaper). This doesn't have to be (nor should it be) a large image. Your browser takes smaller graphics and tiles them so they fill up the entire screen. The secret to background images is the <BODY> tag's BACKGROUND attribute: <BODY BACKGROUND="filename"> Here, filename is the name of the graphics file you want to use. In general, we recommend sticking with just a different background color. Tiled background images take longer to load, and they can make text devilishly difficult to read. Extra ExtensionsCentering ParagraphsCentering text and graphics is a time-honored way to give reports and brochures a professional look and feel. To provide the same advantage to your Web pages, <CENTER> tag gives you centering capabilities for your page headings, paragraphs, lists, and even graphics. Here's how <CENTER> works: <CENTER> The previous figure shows an example of the <CENTER> tag at work.
A Better Horizontal Rule<HR>, you'll recall, displays a horizontal rule across the page. <HR> extensions allow you to change the line's size, width, alignment, and more. Here's a rundown:
The Least You Need to KnowThis chapter took you on a tour of the various extensions to HTML. Here are a few of the tourist attractions you saw during the trip:
|
Make KacMac your home page Add URL - Information Center - Contact us - Terms of Service - Privacy Policy - Advertising |
Copyright © 2004 KacMac. All rights reserved. |