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.
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:
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.
<p>
make sure you include the corresponding closing tag when the sentence ends. 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).
<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:
<p>
Tag only:<p>
and <br>
Tags:<b>
and <br>
TagsThe difference may seem trivial now, but it opens up possibilities when learning to create text of different size and color for future section headings.
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.
<hr>
tag and a <br>
tag are, and what they are used for.Use the <p>
, the <hr>
, or the <br>
tags to create paragraphs or sections in your own document.
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.
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...
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.
Follow these steps to apply style tags to your HTML document.
<b>
cars</b>
<h2>
Terminology</h2>
heading, enter the following:<tt>
Teutonic Engineering</tt>
.
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.
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.
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!
After this lesson, you will be able to:
<b>My Unordered List:</b>
<ul>
<li> Item 1
<li> Item 2
<li> Item 3
</ul>
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:
<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> |
Using the list tags, you will now add an ordered and an unordered list to your Cars web page.
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.
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?
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.
After this lesson, you will be able to:
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.
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.
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 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.
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:
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.