Headings, Line, and Paragraph Breaks
Now that you understand the basic structure of a Web page, you can focus on formatting your text to make it more attractive and better-organized.
As mentioned in the previous exercise, all text formatting, even a simple line break (where text is forced to begin on a new line) is accomplished with tags.
We're going to make some modifications to our original sample Web page to see how these three new tags work.
<.HTML>*** <.HEAD> <.TITLE>My First Web Page<./TITLE> <./HEAD> <.BODY> Welcome to my first Web page! <.P> This is my first experience with HTML and Web page design.Notice we've added one new tag, <.p>. This is the paragraph tag, and it tells the browser the text that follows should appear in a new paragraph. We could have added the closing tag, <./p>, at the end of the paragraph, but in practice, it's not necessary, and very few Web designers do it.
Save the file and load it into your browser to see what happens.
Now we'll add some more text and learn about the line-break tag,
<.br>.
The line-break tag will force the text that follows it to begin on the next line.
<.BODY> Welcome to my first Web page! <.P> This is my first experience with HTML and Web page design.Notice we've added an additional paragraph ("This is what you will need ...") followed by a line break that forces the list of items to begin on the next line. Each item is positioned on a separate line by using additional line-break tags. Save the file and load it into your browser to see the results of this formatting.
Our sample page is beginning to shape up, but it's still rather boring.
| |
HTML has six levels of headings: <.h1> (the largest), <.h2>, <.h3>, <.h4>, <.h5>, and <.h6> (the smallest).
To see how the heading tag works, change the first line of the body text as follows: <.H1>Welcome to my first Web page!<./H1>
Save the HTML file and reload it into your browser.
| ![]() |
Experiment with the rest of the heading sizes by changing the <.h1> to <.h2>, and so on with the remaining sizes.
Remember also to change the <./h1> closing tag, or all the remaining text will display at this larger size.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials. Omit the period in your own html documents. For example: use | |
Text Formatting - Center, Blockquote
The default format for all elements (text or graphics) in HTML is left alignment.
| ![]() |
<.CENTER>*** <.H1>Welcome to my first Web page!<./H1> <./CENTER>This tag tells the browser to display the heading "Welcome to my first Web page!" at the center of the browser window. Go ahead and update your sample page, save it, and reload it in your browser. Resize the browser window by making it narrower or wider and see how the heading is repositioned to automatically display in the center of the window.
There will be times when you want to indent some text to set it apart from the other text.
This is what you'll need to create your own Web pages: <.BR> A text editor or word processor <.BR> A Web browser <.BR> The HTML TutorialLet's make the list of three items stand out a bit more by modifying the section of HTML above as follows: This is what you'll need to create your own Web pages: <.BLOCKQUOTE> A text editor or word processor <.BR> A Web browser <.BR> The HTML Tutorial <./BLOCKQUOTE>Notice we removed the <.br> tag below the first line and replaced it with the <.blockquote> tag. Then the tag was closed by inserting <./blockquote> at the end of the list. Save your changes and see how this new tag improves the page's appearance.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials. Omit the period in your own html documents.
| |
Text Styles - Bold, Underlined, Italic
The next three tags we'll learn about are used to change the appearance of single letters, words, sentences, or paragraphs of text.
| ![]() |
<.B>This is what you will need to build Web pages:<./B>Save your file and view it in your browser. Notice the line "This is what ..." now appears bold. Whatever text you enclose within the <.b> and <./b> tags will be displayed bold in the browser window. Make sure you always close the <.b> tag with the <./b> tag, otherwise, you wind up formatting text you didn't intend to and the page will look rather sloppy.
The underline and italic tags are used in the same manner as the bold tag.
<.B>Here are the three text style tags I have learned:<./B> <.BLOCKQUOTE> This is <.B>bold<./B> text <.BR> This is <.U>underline<./U> text <.BR> This is <.I>italic<./I> text <./BLOCKQUOTE>Be sure to copy it exactly as it appears above. Save the file and view the changes you've made. Your page should now be beginning to take shape.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials.
| |
Font Tags - Font color, Font face :
FONT FAQ
In the previous exercise, we learned how to change the appearance of text by modifying its style (making it bold, italicized, or underlined).
| ![]() |
The structure of the <.font> tag is more complex than the ones we've used so far.
In addition to the name of the tag, you'll supply a parameter and value to indicate what font attribute is to be modified. The font parameters we'll cover here are size, color, and face. The structure of the font tag is as follows: <.FONT PARAMATER ="value">To change the size of the font, for example, we would replace the word parameter with the word size. Then we would need to indicate the desired size of the text by replacing the word value with a number. Browsers are designed to display one of seven different font sizes beginning with size 1 as the smallest and ending with 7 as the largest. The default size of text in all browsers is 3, so all the text you have seen in our example page (with the exception of the heading) has been size 3. Let's take a look at what all the remaining sizes look like. Copy the following HTML into your page after the code from the previous exercise: <.FONT SIZE="1">This is font size 1<./FONT><.BR> <.FONT SIZE="2">This is font size 2<./FONT><.BR> <.FONT SIZE="3">This is font size 3<./FONT><.BR> <.FONT SIZE="4">This is font size 4<./FONT><.BR> <.FONT SIZE="5">This is font size 5<./FONT><.BR> <.FONT SIZE="6">This is font size 6<./FONT><.BR> <.FONT SIZE="7">This is font size 7<./FONT><.BR>Save your page and load it into your browser. These seven font sizes are set by the browser. You can change the font size of any text on your Web page using this tag.
There may be times when you'll want to change the color of text, which is black by default.
RED - FF0000 PINK - FFC0CB MAROON - 800000 VIOLET - EE82EE PURPLE - 800080 GREEN - 008000 LIME - 00FF00 BLUE - 0000FF YELLOW - FFFF00 ORANGE - FFA500 GOLD - FFD700 CYAN/AQUA - 00FFFF BROWN - A52A2A WHITE - FFFFFF BLACK - 000000Better color chart Color Chart Here Enter the following HTML code into your sample page to see how to use the color parameter: <.P> This is an example of <.FONT COLOR="red">red text.<./FONT><.BR> This is an example of <.FONT COLOR="00FF00">green text.<./FONT>Here we have used the color name to specify the color of the red text and the RGB value to specify the color of the green text. It's better to get in the habit of using the RGB values instead of the color names.
You can find a table of the most common colors to use here:
The last font parameter is font face.
If you're using a Windows-based computer, add the following code to your sample Web page:
<.P>
To get around the problem of differences in viewers' installed fonts, the font tag will let you include a list of several possible fonts for the browser to use.
<.P>
Instead of coding our pages for different computer systems, we can use this one line for both the Mac and Windows computer.
Any of the above font parameters can be combined together in one tag as illustrated in the following example:
<.FONT SIZE=3 FACE="Arial,Helvetica" COLOR="blue">
Just be certain to place a space in between each parameter.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials.
Omit the period in your own html documents.
| |
Organizing Your Data with Lists
We often take for granted the power of lists to help us organize tasks and simplify written communication.
| ![]() |
First begin by creating a new Web page.
We'll need two different Web pages for the hyperlink exercise later in this tutorial, so this would be a good time to build a new page.
Create a new document in your text editor or word processor and enter the following HTML: <.HTML>*** <.HEAD> <.TITLE>My Second Web Page<./TITLE> <./HEAD> <.BODY> <.H1>Using additional HTML Tags<./H1> <./BODY> <./HTML>Name the file mypage2.html and save it to your hard drive. You'll be adding to this page in the following exercises.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials.
Ordered lists
Ordered lists are sometimes called numbered lists because the browser sequentially numbers each item in the list.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials.
Unordered lists are also called bulleted lists.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials.
Dividing Up the Page with Horizontal Rules
HTML provides a very simple way to add sections to your Web page -- sort of like a visual punctuation -- without the use of graphics.
The size parameter refers to the height of the line in pixels.
The WIDTH parameter refers to the width of the line in pixels.
The align parameter determines whether the horizontal rule is left, center, or right aligned on the Web page.
Add the following line to your new sample page inbetween the order list and unordered list code from the above exercises:
<.HR >
Save the file and view it in your browser.
You will most often use horizontal rules to create logical divisions, and thus provide visual cues to the viewer to see how the information on your pages is organized.
***We add a period to HTML tags between the < and tag name to show the code in these tutorials.
|