![]() |
HTML QUICK REFERENCE PART 2 - TEXT ALIGNMENT and FONTS |
Bill Biega's Information Series |
Basic HTML Body Body Text Character Entitities Elements Fonts Head Headings Horizontal Lines Lists Images Image Formats Image Links Images & Text Lists Links Meta tags More Studies Paragraphs Tables Table Example Tags Explained Test Yourself Text Formats Tips Troubleshooting |
Principal ElementsHTMLThe tag <html> is the first tag, and the closing </html> is the last tag in the document. This tells the browser where to start and where to end, When you save the completed file you must use the extension .html so that it is recognized as an HTML document.HEADThe Head element <head> contains several items which are read by the Browser and also by Search engines, such as "Google", but they are hidden from the reader. Some of these items are called "Meta Tags" and are optional. They will be discussed later. TITLE
The title element <title>must be the first right after HEAD. It contains your document title which is typically displayed in the title bar at the top of the browser window. The title
identifies your page for search engines and for bookmark lists. It should uniquely describe the contents of your Web page and must be less than 64 characters.
BODYThis is the largest part of your document and starts with the tag <body>.It contains all the elements that the reader will see, such as headings, lists, images, tables, etc. The general appearance of your page is determined by attributes embodied within the BODY tag. If none are specified the Browser will use its default values. bgcolor="#rrggbb" determines the page color, where rr, gg and bb are the hexadecimal values for the amount of red, green and blue. See Colors for a detailed discussion, with color charts. A typical default value is bgcolor="#ffffff" or white. text="#rrggbb" determines the text color, typically "#000000" for black. link="#rrggbb" determines the color of links to other pages, typically "#0000ff" or blue. vlink="#rrggbb" determines the color of a link that has already been visited, typically "#800080" or violet. background="image.gif" provides for a background pattern, see Backgrounds page for more information. NOTE: The background color of this page was set at bgcolor="#ffffcc" "Antique White". |
|||||||||||||||||
Body Text ElementsCarriage returns in HTML files aren't significant. In fact, any amount of whitespace -- including spaces, linefeeds, and carriage returns -- are automatically compressed into a single space when your HTML document is displayed in a browser. Word wrapping can occur at any point in your source file without affecting how the page will be displayed. ParagraphsYou indicate the start of a paragraph with the tag <p>.
The end of a paragraph is shown with the closing tag </p>. Many tutorials tell you that a closing tag is not needed.
You provide a line break without white space between lines with the tag <br>. There is no closing tag, but the new rigorous standards require you to write this tag thus: <br />. For example: My address is: <br />John Doe <br />123 Main Street <br />Newtown, NJ 08901 Headings
HTML has six levels of HEADINGS, numbered 1 through 6, with 1 being
the largest. Headings are typically displayed in larger and/or bolder
fonts than normal body text.
The syntax of the heading element is:
Heading tags may incorporate attributes:
Text AppearanceThere are three tags that change the appearance of any text elements between them:
You may nest tags to combine several elements, but the end tags must be placed in exactly the reverse sequence. For example: <b><i>bold italics </i></b>.
Character EntitiesYou may use all the characters on the typewriter keyboard, including all letters, numerals and symbols (so called "ASCII characters"), except the less-than and greater-than symbols < and > and the ampersand &. These symbols have special meaning in HTML markup code. To represent them we use what are called escape sequences.
There are many accented letters in languages such as French, German, Polish, Russian, etc, that cannot be typed on an English keyboard. See Special characters for a discussion of this complex subject. |
Paragraph alignment This paragraph is aligned left, this is the default mode.
This paragraph is center aligned.
This paragraph is aligned right. Example of address, with line breaks: My address is:
Examples of headings: Title 1Title 2Title 3 centeredTitle 4 right alignedTitle 5
|
|||||||||||||||||
FontsEvery Browser automatically uses a default font face, typically Times Roman.The font size that you see on the screen is determined by the Browser; however you, the user, have control over it. For example in MS Explorer, click on the "View" Tab, then "Text Size", You have 5 choices from Largest to Smallest with Medium being the default size. The Web page designer may specify font face, color and size for the entire document in the <body> specification. You can also change them at any place in the text, for example in a specific paragraph:
You can also change font face to a non-serif style (the most frequently used) as follows:
|
Here is how these two font examples appear on your Browser (this is the default font for your Browser): This is red text, one size larger than default size
| |||||||||||||||||
|
|
|
|||||||||||||||||
| ||||||||||||||||||
|
Return to Top of page, or to Web Design Table of Contents.
Return to Home Page.
Last update November 2003 |