×
About Lessons HTML Reference F&CBP Home Class Schedule






V. Breaking it up into paragraphs

So far you have created and modified HTML documents, and you should feel comfortable with the process of editing text and reloading it into your web browser. So now relax for this fast lesson on inserting paragraph breaks.

Objectives

After this lesson, you will be able to:

Lesson

HTML Paragraph Breaks

We've seen earlier that a web browser will ignore all of the CARRIAGE RETURNS typed into your text editor. But, wherever a browser sees the paragraph tag, it inserts a blank line and starts a new paragraph. The HTML code for forcing a paragraph break is:

<p>..</p>
NOTE: When using HTML it is good practice to remember that the tags come in pairs; an opening tag and a closing tag. There are very few exceptions (empty elements). The difference is that the opening tag is a plain tag and the closing tag contains a "/" before the actual tag.

Also, the <hx> (header tags) have a built in break so it is unnecessary to put <p> tag before a header tag:

Example

<p>
  <h2>Blah Blah Blah Blah</h2>
</p>

Inserting Paragraph Breaks

NOTE: For the purpose of illustrating the use of the tags and so they may be distuinguished easier when viewing the examples, they will be shown being used with carriage returns after them, putting them on a seperate line. That practice is not necessary in regular use. The reason you see it done here is that in plain notepad, everything will appear in monochrome (black on white), so to distuinguish the tags from the text content they are seperated by carriage returns and shown on seperate lines. You will find later when using more advanced editors that things are color coded so that the text content, tags and attributes are easier to distuinguish from one another.

Follow the directions below to insert and view a paragraph break in your HTML document.

  1. Re-open your workspace (if not already opened).
  2. Go to the text editor window.
  3. Open your working document, cars.html, in the text editor (if not already opened).
  4. First we want to move the sentences ("People everywhere are.....") so that they are under the Introduction heading. Use the mouse to cut and paste this text in the proper location.
  5. After these sentences, we want to add some more text. Add the following text:
  6. <p>
    Fascination with cars has existed since the dawn of automobiles. Compare the history of the automobile to the history of industrialization, which over the past 125 years, ran almost in parallel.
    </p>
  7. Now, return to your HTML document in the text editor, and paste this text after the existing sentences under the <h2>Introduction</h2> heading.
  8. Save the changes in the text editor.
  9. Return to your web browser.
  10. Select Reload from the File menu. You should now see the two sentences of the Introduction. We now want to put paragraph tags around both of these sentences.
  11. Again, return to your HTML document in the text editor.
  12. Before the first sentence under <h2>Introduction</h2>, press RETURN (it is not necessary but it makes the HTML more readable as you work on it), and then enter the paragraph tag: <p> make sure you include the corresponding closing tag when the sentence ends.
  13. Then do the same for the next sentence.
  14. This section should now look like:
  15. <h2>Introduction</h2>
    <p>
    People everywhere are fascinated by exotic, sporty and luxurious cars they most likely cannot even afford. This fascination is driven by a combination of exorbitant cost, beauty of the design, rarity, or brand recognition.
    </p>
    <p>
    Fascination with cars has existed since the dawn of automobiles. Compare the history of the automobile to the history of industrialization, which over the past 125 years, ran almost in parallel.
    </p>
  16. Save the changes in the text editor.
  17. Return to your web browser and Reload the document. The two sentences of the introduction should now be separate paragraphs.

Other Types of Breaks

To separate major sections of a web page, use the horizontal rule <hr> tag. This inserts a straight line like you see right above the heading for this section (5. Breaking it up into paragraphs).

The HTML format for a horizontal rule tag is: <hr> Let's try it now! Put an <hr> tag above the Introduction heading in your document named cars.html, this will help to separate the opening sentence of the lesson from other portions that will follow. Also, there is the <br> tag which forces text to a new line like the <p> tag, but without inserting a blank line. You might use this tag when making a list of items, when writing the lines of a poem, etc. Compare the differences between using the <br> and <p> in these two examples:

Examples

<p>Tag only:

And then, we could all see at once the brilliant purpose of the paragraph tag.
<p>
Moving on...
<p>
The more tags you write, the better you will feel?


Sample Result

breaks (19K)


<p> and <br> Tags:

And then, we could all see<br>
at once the brilliant purpose<br>
of the paragraph tag. <br>
<p>
Moving on... <br>
the more tags you write,<br>
the better you will feel?<br>
<p>


Sample Result

breaks2 (19K)


Section Titles w/ Header Tags

and in the end it was all for naught.
<h4>The New Cheese Edict</h4>
Later, Sir Longhorn declared that all makers of cheese would have to be certified before commencing production.


Sample Result

breaks3 (15K)


Section Titles w/<b> and <br> Tags

and in the end it was all for naught.
<p>
<b>The New Cheese Edict</b><br>
Later, Sir Longhorn declared that all makers of cheese would have to be certified before commencing production.?


breaks4 (17K)

The difference may seem trivial now, but it opens up possibilities when learning to create text of different size and color for future section headings.

Check your Work

If you would like, compare your web page to this sample. If your document was different from the sample, review how you entered the paragraph break, <p>, into the text editor. Make sure you entered it as instructed in the Inserting Paragraph Breaks section of this lesson.

Review Topics

  1. What is the HTML tag for a paragraph break?
  2. What steps did you use for inserting a paragraph break in your document?
  3. How did you display and view the changes in your web browser?
  4. * Extra Credit: Explain what a horizontal rule <hr> tag and a <br> tag are, and what they are used for.

Independent Practice

Use the <p>, the <hr>, or the <br> tags to create paragraphs or sections in your own document.







VI. Doing it with Style

Just like a word processor, HTML can tell a web browser to display certain portions of text in Italic or Bold Style or even a combination.

Objectives

After this lesson, you will be able to:

Lesson

HTML Style Tags

HTML offers several tags for adding style to your text. Just remember to be judicious and consistent in the use of styles; too much can make the text uncomfortable to read...

Examples


Style Tags

<b>This is Bold...</b>
<i>This is Italic...</i>
<tt>This is Typewriter...</tt>

Sample Result

style (15K)



Style Tags

<i><b>This is Bold AND Italic</b></i>
<b><i>And So is This</i></b>

Sample Result

style2 (15K)
blah blah blah
<h2><i>New</i> and <tt>Improved!</tt></h2>
blah blah blah

NOTE: In the example above you see how you can combine the style tags as long as they are correctly nested, the italic tags are both within the bold tags. Note also, that the order the sets are used does not matter as long as it the sets are in consistent order.

Entering Styled Text in your HTML Document

Follow these steps to apply style tags to your HTML document.

  1. Re-open your workspace (if not already opened).
  2. Return to your HTML document, cars.html, in the text editor.
  3. Find the word "cars" in the first sentence of the Introduction. We are going to make this bold to highlight an important word.
  4. Insert the tags to make this word appear as bold text: <b>cars</b>
  5. Now we will modify the second paragraph with the bold and italic tags to emphasize a word. Enter <b>...</b> and <i>...</i> tags around "125 years" so this section looks like:

Example


<p>
Fascination with cars has existed since the dawn of automobiles. Compare the history of the automobile to the history of industrialization, which over the past <b><i>125 years</i></b>, ran almost in parallel.
</p>

  1. Finally, we will use the typewriter, tag to indicate a special word. Under the <h2>Terminology</h2> heading, enter the following:
    Many uncommon terms are encountered with the interest in cars, such as <tt>Teutonic Engineering</tt>.
  2. Save in the text editor and Reload in your web browser.

Check your Work

Compare with the sample that shows these changes. It is important when using style tags to properly close the tag(s) with the proper </> tag. Otherwise, all succeeding text will inherit this text style. It can look bizarre and get frustrating to find.

Review Topics

  1. What are HTML style tags?
  2. What are the different tags used for different styles of text?
  3. What steps did you use in entering styled text into your HTML document?
  4. *Extra Credit: How can these styles be useful in creating a web page or lesson?

Independent Practice

Try using the style tags for bold, italic, and typewriter to the text of your own web page. See if you can successfully combine styles... that are pleasing to read.







VII. Lists, Lists, Lists

Lists can present items of information in an easy-to-read format. In fact, there is a list right here, lurking under the next heading!

Objectives

After this lesson, you will be able to:

Lesson

Many web pages display lists of items -- these may be items preceded with a "bullet" (Unordered) or a sequentially numbered list (Ordered). These lists are easy to format in HTML, and they may even be nested (lists of lists) to produce an outline format. Lists are also handy for creating an index or table of contents to a series of documents or chapters. Unordered Lists Unordered Lists, or <ul> .. </ul> tags, are ones that appear as a list of items with "bullets" or markers in the front. The bullet marks will depend on the particular version of your web browser and the font specified for displaying normal WWW text (e.g. for Macintosh, the bullets are the option-8 character -- in Times font this is a small square, in Geneva it is a large round dot). Here is an example of an unordered list:

Example


Unordered Lists

<b>My Unordered List:</b>
  <ul>
    <li> Item 1
    <li> Item 2
    <li> Item 3
  </ul>


Sample Result

lists (16K)

Note: The <ul> tag marks the beginning and end of the list, and the <li> indicates each list item.

Ordered lists are ones where the browser numbers each successive list item starting with "1." Note that the only difference is changing the <ul> tag to <ol> tag. Using the example from above:


Example


Ordered Lists

<b>My Ordered List:</b>
   <ol>
     <li> Item 1
     <li> Item 2
   </ol>

Sample Result

lists2 (16K)

Nested Lists

Ordered Lists and Unordered lists can have different levels; each will be indented appropriately by your web browser. Your major concern will be to verify that each list is properly terminated and the nesting order is correct. It can start to look complicated with all of those <ol>, <li>, </ul>, <li> tags floating around, but just try to remember the basic structure:
NOTE: The basic structure consists of the opening list tag followed by the list items and completed with a closing list tag (for easier identification indent the list items).

<ul>
<ol>
   <li>..</li>
   <li>..</li>
   <li>..</li>
...or    <li>..</li>
</ul>
</ol>

Example


Nested Lists

<b>Nested Unordered List</b>
<ul>
  <li>This is the first item</li>
  <li>This is the second item</li>
    <ul>
      <li> This is the first sub item of the second item</li>
        <ul>
        <li> And this is a sub item of a sub item</li>
        <li> Getting lost yet?</li>
        </ul>
      <li> This is the second sub item of the second item</li>
      <li> This is the third sub item of the second item</li>
    </ul>
  <li>This is the third item</li>
</ul>

Sample Result

lists3 (24K)



Mixed Nested List

<b>Nested Unordered List</b>
<ol>
  <li>This is the first item</li>
  <li>This is the second item</li>
    <ul>
    <li> This is the first sub item of the second item</li>
      <ol>
       <li> And this is a numbered sub item of a sub item</li>
       <li> And this is another numbered sub item of a sub item</li>
       <li> Getting lost yet?</li>
      </ol>
    <li> This is the second sub item of the second item</li>
    <li> This is the third sub item of the second item</li>
   </ul>
  <li>This is the third item</li>
</ol>

Sample Result

lists4 (27K)

Placing Lists into your Project HTML Document

Using the list tags, you will now add an ordered and an unordered list to your Cars web page.

  1. Re-open your workspace (if not already opened).
  2. Open your HTML document in the text editor.
  3. Under the Terminology header we will use an unordered list to display examples of terms used with performance cars. Go to this section in your HTML document.
  4. First add the following sentence.
  5. <p>How many of these do you know?</p>
  6. Now enter the following HTML format to create the list of terms:
  7. <ul>
       <li>Carbon Fiber</li>
       <li>Direct Injection</li>
       <li>Hemi</li>
       <li>Carbon Ceramic Brakes</li>
    </ul>
  8. Now we will use an ordered list to define the required parts of the assignment in this lesson. At the end of the document add a horizontal rule followed by a new heading named "Research Project" and designated as a Heading 2. Your mission is to find information and report on a car of your choice, from the ones listed. Your reports must include:
  9. <ol>
       <li>Type of Car</li>
       <li>Geographic location of the manufacturer</li>
       <li>Noteworthy details</li>
       <li>Comparable vehicles</li>
       <li>The reason you like the car</li>
    </ol>
    <br>
    Then, write a one paragraph description of how the performance vehicles of today compare to the muscle cars of the 60's and 70's.
  10. Save your HTML file and Reload in your web browser.

Check Your Work

You may want to compare your document with a sample for this section. If your list is different than the list in the sample, review how you entered your list in your text editor. Make sure it matches the instructions in the Placing Lists in Your HTML Document section of this lesson.

Review Topics

  1. How are lists valuable in a web page?
  2. What is the HTML tag for an unordered list?
  3. What is the tag for an ordered list?
  4. How might you set up a nested list?
  5. What steps did you use in adding a list to your HTML document?

Independent Practice

You may want to experiment with changing the ordered list you created to one that is unordered. Also, insert an ordered or an unordered list of items to your own web document. Be sure to verify that it displays correctly in your web browser. Can you create a list that includes sub-lists?







VIII. Graphics á la "the Web"

Sending text over the Internet is just so bland. People have been doing it for decades! When you can include Pictures, your message can be much more informative! There is a reason they coined the phrase: "...a picture is worth a 1000 words". Pictures allow a person to see something clearer than most can explain. They can be used to present a product, tell a story or clarify a concept.

Objectives

After this lesson, you will be able to:

Lesson

Lean back and relax! This lesson is mostly an introduction to graphics for the Web. But you will have to do a little activity below.

The Web's Graphic Format

There are numerous file formats for computer graphics... PICT, GIF, TIFF, PNG, not to mention EPS, BMP, PCX, JPEG, etc... It sounds like alphabet soup!

The way a web browser displays graphics in HTML format indicates the location of a graphic file in a single format that can be interpreted by different types of computers. For example, when the information in that format is received by your Macintosh computer, the web browser knows to display it as a picture format for Macintosh. However, when that same information is received by your Windows browser, it is displayed as a Windows graphic.

In technical jargon, we would say that this picture format is platform independent. HTML itself is platform independent, since plain text characters can be understood by any computer.

The granddaddy of all online graphics is the GIF or Graphics Interchange Format. The GIF compresses the picture information (reduces the file size) and translates it to binary code that can be sent over the Internet. GIF compression is most effective on graphics that have contiguous areas of solid color, and compression is even greater when the color is continuous in the horizontal direction. GIF images have the feature of defining a color to be "transparent" so images can appear to have non-rectangular boundaries.

The other widely used format used on the web is JPEG (named after the Joint Photographic Expert Group that designed this format). In the early web years, JPEG images were not displayed in the page but were displayed in a separate window, using an external "helper" application. Now all web browsers support JPEG images to be displayed right in the web page. JPEG compression is very effective for photographic images where the colors can vary spatially over short distances ("grainy" images). JPEG offers some dramatic compression in file size, sometimes by a factor of 10 (e.g. a 1500 kb file reduced to 150 kb), which may be at a trade-off for some image quality. JPEG images do not have the ability to have transparency.

Another popular file format for graphics on the web is the PNG (Portable Network Graphic). It has a good balance between features and file size. Besides a GIF this is the only other file format that can display transparencies.

There is also the BMP (Bitmap) format, which is most appropriate for photo-realistic images or complex drawings. Unfortunately it creates a very large file size and is not commonly used for web pages. Bit-depth determines the number of colors that can be displayed (monochrome, 16-color, 256-color, 24-bit or 32-bit) by an individual pixel.

Then there is the SVG (Scalable Vector Graphics) format, which is the most appropriate for drawn shapes (mathematically expressed such as from CAD software). They can be filled with color or patterns and file sizes are usually a fraction of the size of a Bitmap. Vector graphics do require a Flash plug-in to display on the web.

There are many graphics formats to choose from and as you can see some have specific features that would cause choosing one over another for certain situations.

More and more graphics programs have built-in features to save files as GIF format. Software such as ImageReady and Fireworks from Adobe have been specifically designed for creating web graphics. Adobe also offers other premium software which are valuable for graphics editing and creation, such as Illustrator and Photoshop. You can find other shareware programs/utilities such as Artweaver for converting graphics to web format at sites such as download.com. The most valuable feature on any graphics program is the ability to optimize the graphic for file for size. Remember, the smaller the image (dimensions) the less detail or image quality you can get away with.

Points to Consider when Using Graphics

For this tutorial, it will not be necessary to use one of these graphics programs. This tutorial will explain how to get a copy of the images that you will need to complete this project. For independent practice though it is encouraged to explore Artweaver for manipulating images so that as you begin to develop your own web pages, you will be familiar with creating images in GIF, JPEG, PNG or any other usable format.

If your web pages include graphics, consider the following points:

You may design a beautiful web page, loaded with large pictures that may look nice, but may adversely affect bandwidth usage on both the host and user ends. The 'net is a busy place and getting busier every second so efficiency is a good goal to keep in mind.

Saving and Including Pictures in Your Web Page

For the next lesson you will first need to find a copy of a GIF image. Under normal circumstances you would just access the internet and retrieve an image of anything you wanted but since there is no internet access we will have to make do with what is available on your local computer.

For this exercise you will need a specific image made for this tutorial and the simple way to accomplish this task is for you to open the folder by clicking the following link to access the folder. Click here to access the Logos folder. Look for the file named "ferrari logo.gif" and select it by clicking on it once. When the image appears in the browser, right click on it and choose the "save as" option. Before saving it look for the "create new folder" icon to the right of the "save in" dialog box, name this folder "images". Then save it. You should now have saved this image in the images folder which is within your HTML 101 folder.

NOTE: As of the HTML 4 standard, it is imperative that with any filename containing a space, you use %20 to fill the blank!! For example, ferrari logo.gif needs to be entered as ferrari%20logo.gif when entering as HTML. To avoid having to do this, do not use any spaces in filenames and use underscores or CamelCase instead.

Check Your Work

Check to see that the file, ferrari logo.gif, is saved in the images folder within the same folder as your HTML file, "cars.html". If it is not there, check to see if you accidentally saved it in another directory/folder. Then, move it to the correct location.

Review Topics

  1. Name at least 3 graphic formats used for the World Wide Web?
  2. Name the graphic file format you would most likely use to post photographs from your vacation onto a website?
  3. What are some key points to consider when including graphics in web pages?
  4. How did you save the ferrari logo graphic for use in your web document?

Independent Practice

Pay close attention here! Go to "My Documents" (the folder may be named Student's Documents on some computers) and follow these steps all the way to the images folder JMAC ->FCBP Web ->Class Info ->Web Design ->HTML 101 ->images. When you get to the "HTML 101" folder, look for the images folder. Right-click it once, choose, click copy, then open your HTML 101 folder you have for this class. Right click in it and click on paste. You will see the following:

replace (29K)

If in fact you do see this message, then at least you know you have done something right because it means that it recognizes the images folder that you created here earlier. If that is the case then click "yes to all". If not, I would strongly advise for you to call for help to see what you missed! With this step complete you will now have the entire image folder with all images that you will need for this project stored in your folder.