Download Notes Free Amazing Pics Tutorials

Free Notes | Amazing Pictures | Photoshop Tutorials | Drafting and Drawing Tutorials | HTML Tutorials for FREE

Showing posts with label Learning HTML. Show all posts
Showing posts with label Learning HTML. Show all posts

Wednesday, August 11, 2010

Internet_History_and_Growth.ppt

Wednesday, August 11, 2010




Topics:

  • Internet History
  • Internet EvolutionInternet Pioneers
  • Internet Growth
  • Conclusion
Download this PowerPoint Presentation

Monday, July 19, 2010

Pharagraph Example in HTML

Monday, July 19, 2010
<html>
<body>

<p>
    My Bonnie lies over the ocean.


    My Bonnie lies over the sea.


    My Bonnie lies over the ocean.

  
    Oh, bring back my Bonnie to me.
</p>




<p>Note that your browser ignores the layout!</p>

</body>
</html>

Results in browser:

My Bonnie lies over the ocean. My Bonnie lies over the sea. My Bonnie lies over the ocean. Oh, bring back my Bonnie to me.
Note that your browser ignores the layout!
=================================================
How HTML paragraphs are displayed in a browser

<html>
<body>

<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>

</body>
</html>


This is a paragraph.
This is a paragraph.
This is a paragraph.
=================================================
 The use of line breaks in an HTML document. 

<html>
<body>

<p>This is<br />a para<br />graph with line breaks</p>

</body>
</html>

This is
a para
graph with line breaks
==================================================

The default behaviors of paragraphs

<html>
<body>

<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>

<p>
This paragraph
contains      a lot of spaces
in the source     code,
but the    browser
ignores it.
</p>

<p>
The number of lines in a paragraph depends on the size of your browser window. If you resize the browser window, the number of lines in this paragraph will change.
</p>

</body>
</html>

This paragraph contains a lot of lines in the source code, but the browser ignores it.

This paragraph contains a lot of spaces in the source code, but the browser ignores it.

The number of lines in a paragraph depends on the size of your browser window. If you resize the browser window, the number of lines in this paragraph will change.

HTML Attributes

Monday, July 19, 2010

HTML Attributes

  • HTML elements can have attributes
  • Attributes provide additional information about an element
  • Attributes are always specified in the start tag
  • Attributes come in name/value pairs like: name="value"

Attribute Example

HTML links are defined with the <a> tag. The link address is specified in the href attribute:

Example

<a href="http://www.w3schools.com">This is a link</a>



Always Quote Attribute Values

Attribute values should always be enclosed in quotes.
Double style quotes are the most common, but single style quotes are also allowed.
Remark Tip: In some rare situations, when the attribute value itself contains quotes, it is necessary to use single quotes: name='John "ShotGun" Nelson'

HTML Tip: Use Lowercase Attributes

Attribute names and attribute values are case-insensitive.
However, the World Wide Web Consortium (W3C) recommends lowercase attributes/attribute values in their HTML 4 recommendation.
Newer versions of (X)HTML will demand lowercase attributes.

HTML Attributes Reference

Below is a list of some attributes that are standard for most HTML elements:
Attribute Value Description
class classname Specifies a classname for an element
id id Specifies a unique id for an element
style style_definition Specifies an inline style for an element
title tooltip_text  Specifies extra information about an element (displayed as a tool tip)

HTML Elements

Monday, July 19, 2010
An HTML element is everything from the start tag to the end tag:
Start tag * Element content End tag *
<p> This is a paragraph </p>
<a href="default.htm" > This is a link </a>
<br />    
* The start tag is often called the opening tag. The end tag is often called the closing tag.

HTML Element Syntax

  • An HTML element starts with a start tag / opening tag
  • An HTML element ends with an end tag / closing tag
  • The element content is everything between the start and the end tag
  • Some HTML elements have empty content
  • Empty elements are closed in the start tag
  • Most HTML elements can have attributes


Nested HTML Elements

Most HTML elements can be nested (can contain other HTML elements).
HTML documents consist of nested HTML elements.

HTML Document Example

<html>

<body>
<p>This is my first paragraph.</p>
</body>

</html>

The example above contains 3 HTML elements.

HTML Example Explained

The <p> element:
<p>This is my first paragraph.</p>
The <p> element defines a paragraph in the HTML document.
The element has a start tag <p> and an end tag </p>.
The element content is: This is my first paragraph.
The <body> element:
<body>
<p>This is my first paragraph.</p>
</body>
The <body> element defines the body of the HTML document.
The element has a start tag <body> and an end tag </body>.
The element content is another HTML element (a p element).
The <html> element:
<html>

<body>
<p>This is my first paragraph.</p>
</body>

</html>
The <html> element defines the whole HTML document.
The element has a start tag <html> and an end tag </html>.
The element content is another HTML element (the body element).

Don't Forget the End Tag

Most browsers will display HTML correctly even if you forget the end tag:
<p>This is a paragraph
<p>This is a paragraph
The example above will work in most browsers, but don't rely on it. Forgetting the end tag can produce unexpected results or errors.
Note: Future version of HTML will not allow you to skip end tags.

Empty HTML Elements

HTML elements with no content are called empty elements. Empty elements can be closed in the start tag.
<br> is an empty element without a closing tag (the <br> tag defines a line break).
In XHTML, XML, and future versions of HTML, all elements must be closed.
Adding a slash to the start tag, like <br />, is the proper way of closing empty elements, accepted by HTML, XHTML and XML.
Even if <br> works in all browsers, writing <br /> instead is more future proof.

HTML Tip: Use Lowercase Tags

HTML tags are not case sensitive: <P> means the same as <p>. Many web sites use uppercase HTML tags.
W3Schools use lowercase tags because the World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in future versions of (X)HTML.

Sunday, July 18, 2010

Chapter 12: More on Tables

Sunday, July 18, 2010
So far, we've covered some of the basics to table design. Now let's dig deeper to learn how to change them to suit our needs.
First, let's again look at the table code illustration used in Chapter 11.
tablecode.jpg (14175 bytes)

Table Tag
To create a table you must used the following container tag:

<table>...</table>

This let's the browser know that a table is forthcoming.

Row Tag
Each table has at least one row and within that row are columns or what is also referred to as cells. The row tag looks like this:

<tr>...</tr>

See how the row tag wraps around the column (cell) tags? You can have several rows, which will be exploring in this chapter.

Column/Cell tag
And finally, to complete your table you must have the column or cell tag--this is where you information and images go. The column/cell tag looks like this:

<td>...</td>

Notice that I keep on using the words column and cell together. That's because in HTML tables, these words are often used to mean the same thing. It can be confusing at times.
Maybe an illustration can help. Here is a table with lots of rows and cells (columns).
spanning1.jpg (13694 bytes)
Notice how this table is like a grid made up of rows and cells. The word "cell" is also referred to as a  "column" and there lies some confusion. So when you work with tables, try to remember that the word cells and columns are often used to mean the same thing. Sometimes it will be hard to remember, so refer back to this chart to remind you.

A table with multiple rows and columns/cells
Now that we've gone through the table tags and have a beginning understanding of rows and columns, let's create a table with several rows and a couple of columns each.


Step 1 Open up your text editor.

Step 2 Enter the following code.
<html>
<head>
<title> Rows </title>
</head>
<body>
<h1>Here's a table with two rows</h1>
<table border="1">
<tr>
<td>This is column one</td>
<td>This is column two</td>
</tr>
<tr>
<td>This is column A</td>
<td>This is column B</td>
</tr>
</table>
</body>
</html>


Step 3 Save the file as rows.html

Step 4 Open Netscape Navigator

Step 5 View the page in the browser.

If all went right, you now have two rows and two columns/cells. Now let's examine the column/cell tag.


Column/cell tag and its attributes

In Chapter 11, we learned about a couple of attributes--bgcolor and width. You can use these in the table tag (<table>), and the column/cell tag (<td>). You can also use other attributes in the column/cell tag, such as:
  1. align: sets your text or image to left, center or right
  2. valign: sets your content vertically to top, center or bottom
  3. colspan: expands across multiple columns/cells
  4. rowspan: expands over multiple rows
Let's examine each attribute separately.

Align attribute
Leaving your text or image to the left of your column is usually pretty boring, so the align attribute lets you center things, using "center" or place them to the right, using "right".


Valign attribute
When placing copy in a column, the browser will automatically place it in the center of the column. You can change this default by using the valign attributes of "top", "center" or "bottom".

Let's apply these two attributes now before we continue.

Step 1 Open up your text editor.

Step 2 Enter the following code.
<html>
<head>
<title> Alignment Attributes </title>
</head>
<body>
<h1>Here are some examples of alignment</h1>
<table border="1" width="100%">

<tr>
<td bgcolor="#ff0000" width="40%" align="right">

This is column one<br>
This is column one<br>
This is column one<br>
This is column one<br>
</td>
<td width="60%">

This is column two<br>
This is column two<br>
This is column two<br>
This is column two<br>
</td>
</tr>

<tr>
<td bgcolor="#ffff00" width="40%" align="center">

This is column A<br>
This is column A<br>
This is column A<br>
This is column A<br>
This is column A<br>
This is column A<br>
</td>
<td bgcolor="#0000ff" width="60" valign="bottom">

<font color="#FFFFFF">
This is column b<br>
This is column b<br>
This is column b<br>
</font>

</td>
</tr>

</table>
</body>

Step 3 Save the file as alignment.html

Step 4 Open Netscape Navigator

Step 5 View the page in the browser.

If all went well, you should have a very colorful table with two rows and four columns (cells). Now we are ready to explore expanding these rows and columns (cells) in order to add interest to a page.

Spanning rows and columns
Ever wonder how some pages have such wonderful layouts? They're using tables. To see what I mean, take a look at these links:

Even though some of these Web sites are using some advanced things like frames and java script (coming soon!), each one uses tables as their basic structure. Learning to span rows and columns can help you add variety to your tables too!

To begin, let's look at our previous illustration, but this time with some rows and columns expanded.
spanning2.jpg (11718 bytes)
When creating a table and you want to expand a column or a row you use the following attributes:
  • colspan: expands across a number of columns
  • rowspan: expands across a number of rows
Let's try this with some code:

Step 1 Open up your text editor.


Step 2 Enter the following code.
<html>
<head>
<title> Rowspan and Colspan </title>
</head>
<body>
<h1>Here's a table demonstrating rowspan and colspan</h1>
<table border="1">

<tr>
<td rowspan="2">This is an example of rowspan. It is spanning two rows.</td>
<td>This is column B</td>
<td>This is column C</td>
</tr>

<tr>
<td>This is column D</td>
<td>This is column E</td>
</tr>

<tr>
<td colspan="3">This is an example of colspan. It is spanning three columns.</td>
</tr>

</table>
</body>
</html>


Step 3 Save the file as span.html

Step 4 Open Netscape Navigator

Step 5 View the page in the browser.

Download in PDF Format HERE:

Chapter 11: Building Web pages with tables

Sunday, July 18, 2010
Tables have literally changed the look of the Web page. Originally, tables let people present data (mostly numbers) in a column format. Designers quickly figured out ways to improve the layout of their pages using tables. Although a bit complicated and sometimes difficult to understand, tables do improve your layout and let you present your material in a more eye-appealing way.
For example, this page--in fact, this whole tutorial--has been developed using a four-column table. The best way to understand tables is to look at the following illustration.

tablecode.jpg (19260 bytes)

The structure of a table
Every table is wrapped by the <table>...</table> tag. Then, the columns are surrounded by the <tr>...</tr> tag. You can have one column or as many as you want. In the above illustration, we are looking at three columns. Now each column has its own tag: <td>...</td>. Although these columns appear horizontally in code, they actually represent vertical columns. So the above illustration  represents a set of columns like this:

column.jpg 
(8550 bytes)
Tables can be very complex. However, we will create a simple column format. Using some of the basic HTML tags you have learned so far, let's create a new Web page with tables.
Step 1 Open up a text editor (remember, Simple Text for Mac and Notepad for Windows.

Step 2 Enter the following code:
<html>
<head>
<title> This is a page using tables </title>
</head>
<body bgcolor="ffffff" text="000000">
<h1>A Web Page Using Tables</h1>
<table border="1">
<tr>
<td>This is column one</td>
<td>This is column two</td>
<td>This is column three</td>
</tr>
</table>
</body>
</html>

Step 3 Save the file as table1.html

Step 4 Opening Mozilla Firefox

Step 5 View the page in the browser.
Notice that I've included a border with a value of 1. When designing a page, it helps to keep the border attribute in the code just so you know where things are. Then after you are pleased with the design, you can take out the border attribute. Some folks like the border on all the time. It's your choice--you're the designer.

Now let's add some copy to our columns. And see what happens. Add the code listed in red.
Step 1 Open the file table1.html

Step 2 Add the code highlighted in red:
<html>
<head>
<title> This is a page using tables </title>
</head>
<body bgcolor="#ffffff" text="#000000">
<h1>A Web Page Using Tables</h1>
<table border="1">
<tr>

<td bgcolor="#000000">
<font color="#ffffff">
<b>This is column one</b>
<br>
I enjoy working on HTML code. It gives me a chance to be creative.</font>

</td>
<td bgcolor="#bee3c2"> <b>This is column two</b></td>

<td bgcolor="#ff8000">
<font color="#804000">
<b>
This is column three<br>Notice what happens to the column when you add copy. It gets larger. This can cause a problem. But we do have a way to control the margins in tables.</b>
</font>
</td>

</tr>
</table>
</body>
</html>

Step 3 Save the file as table2.html

Step 4 Opening Mozilla Firefox

Step 5 View the page in the browser.

Table width
As you can see from the two examples above, the column widths change as you add text (or an image). What you need is some control. And you have it in two ways:
  1. Setting the pixel measurement for the table and its columns as a fixed measurement.
  2. Setting the widths based on the percentage of the screen's width.
Both ways are used  by designers. It's really a matter of choice. Let's look at both methods.

Pixel table measurement
The average screen (across all platforms) measures at 595 pixels (width) by 295 pixels (length). Any wider than 595 and some screens will run your text and images straight through the right-hand side of your screen. Not a good option.
So you definitely want to keep your full table size at 595 pixels using the width attribute. Each column within that table should not individually add up to more than 595.  Let's use our code as a way to learn:

Step 1 Open up your file table2.html.

Step 2 Now add the code in highlighted in red.
<html>
<head>
<title> This is a page using tables </title>
</head>
<body bgcolor="#ffffff" text="#000000">
<h1>A Web Page Using Tables</h1>
<table border="1"
width="595">
<tr>

<td bgcolor="#000000"
width="20">
<font color="#ffffff">
<b>This is column one</b>
<br>
I enjoy working on HTML code. It gives me a chance to be creative.
</td>

<td bgcolor="#bee3c2"
width="100">
<b>This is column two</b>
</td>

<td bgcolor="#ff8000"
width="475">
<font color="#804000">
<b>This is column three<br>Notice what happens to the column when you add copy. It gets larger. This can cause a problem. But we do have a way to control the margins in tables.</b>
</font>
</td>

</tr>
</table>
</body>
</html>

Step 3 Save the file as table3.html Now view it in Firefox.
 
Step 4 If all went well, you page should look like this in your browser

Notice the width in each column. If you add up the widths in each column, you will find it comes to 595 pixels. It's important to do your math when you're working with columns.
Play around with the code, change the width numbers and see what happens. When you're  done, let me show you another way to control your table widths.

Control table width by percentages
The other way to control the width of your columns is by using percentages. This makes your page more "dynamic" because the tables and columns adjust according to the screen size. If the screen is 595 pixels wide, it will fit within 595 pixels. But if your screen is 640 or more, the table will spread out to fit the entire 640. Let's try it with your current page.
Step 1 Open table3.html and save it as table4.html

Step 2 Add the changes indicated in red.
<html>
<head>
<title> This is a page using tables </title>
</head>
<body bgcolor="#ffffff" text="#000000">
<h1>A Web Page Using Tables<h1>
<table border="1"
width="100%">
<tr>

<td bgcolor="#000000"
width="20%">
<font color="#ffffff">
<b>This is column one</b>
<br>
I enjoy working on HTML code. It gives me a chance to be creative.
</td>

<td bgcolor="#bee3c2"
width="60%"> <b>This is column two</b></td>

<td bgcolor="#ff8000"
width="20%"><font color="#804000"><b>This is column three<br>Notice what happens to the column when you add copy. It gets larger. This can cause a problem. But we do have a way to control the margins in tables.</b>
</font>
</td>

</tr>
</table>
</body>
</html>

Step 3 Save the file as table4.html. Now view it in Mozilla.

Step 4 If all went well, you page should look like this in your browser.
Wow, you deserve a break. One last chapter--more stuff on tables. It's a pretty big topic.

Download in PDF Format HERE:

Chapter 10: Working with Graphics

Sunday, July 18, 2010
What would a Web page look like without graphics? Pretty boring to say the least! But not so long ago, that’s just what the Web was like—just plain, boring text. Remember, in those early days the Web’s sole purpose was to exchange information. The real change came when designers added graphics. Nowadays, we’ve become used to seeing bright and colorful pages.

Some details.
It wasn’t always so colorful and so easy to place images onto a Web page. From the start, images have always been memory and space hogs. But during the past few years, designers have worked hard to keep image files small, while also increasing the quality of the artwork that appears on the Web today.

Two file formats have been developed to help keep files small, while maintain a high level of quality:
.gif files: graphic interchange format (pronounced like Jif peanut butter)
.jpg files: joint photographic experts group (pronounced jay-peg)

There are some advantages particular to both. The gif format is the oldest, created by CompuServe to provide a way to show graphics no matter what computer you are using (it’s called cross-platform). Later, the "gif89" format was created so that the image background becomes transparent. That’s a good thing when working with colored page backgrounds. The gif format is also better for line art.

On the other hand, the jpg format was originally created to store photographs. Files formatted in jpg are larger than those in gif, and they do not have transparent backgrounds.
If you have images that are not in one of these two formats, you will need an image editor to convert them. Two such programs are Adobe® PhotoShop or Paint Shop Pro (a shareware program that you can download at Jasc Software).

The Image tag
To place an image onto a Web page you will need to use the image tag. There are two very important things to remember about the image tag:

  1. It’s an empty tag (remember, that means there’s no closing tag, only a beginning).
  2. It requires attributes to be effective.

The image tag <img> has several attributes:
src--identifies the image and tells the browser where to get the image
alt—gives alternative text for those who are not viewing their pages as images.
height & width—tells the browser the size of the graphic (speeds up the downloading process
Let’s go through each one of the attributes in more detail.

SRC attribute
To help the browser identify and find an image, you use the following command:

<img src="filename.gif">
I’d like to cover a couple of important things here. While the name of the file is important, it is equally important to direct the browsers to where the file is located. The browser will not show your image if it can’t find it.
Let’s see if I can demonstrate this process through the following diagram.
graphic.gif
 (6281 bytes)
Notice that all the files are in the same folder or what is also called a directory. So the browser will first look into the main folder (Mikes Bike Shop), find the HTML file (shop.html), load the text and then load the graphic files (horn.gif and bike.gif). That’s why you see those funny little boxes when a page is loading. The browser downloads all the easy stuff first (the text) and then the larger and more complex graphic files last.

Alt attribute
Sometimes people turn off their image loading option in their browser, leaving a Web page with lots of blank boxes. So all the work you have done to place those important images is gone, leaving in its wake only blank, boring boxes.


The alt attribute lets the user know what’s in the picture by providing descriptive text. It also has an added feature with the latest versions of Internet Explorer and Netscape Navigator. When the cursor arrow passes over artwork or a photo, a little rectangular box pops up that contains the alt copy. It’s a great way to add interest to your page or even give instructions to the user.
Here’s an example. Place your arrow (cursor) over the image below. If you have the latest version of IE or Navigator, you will see a pop-up box that says, "When things go wrong with your code, you need to do some detective work!"
When things
 go wrong with your code, you need to do some detective work!
The image tag for this graphic looks like this:
<img src="mystery.jpg" alt="When things go wrong with your code, you need to do some detective work!">


Height & Width attribute
When placing your images onto the screen, the browser looks for the height and width of your images. This is an excellent feature because it allows the browsers to set the space size aside while laying out the balance of the page. If you do not specify the size, the browser will stretch it or reduce it to fit.


Height and width are listed in pixels--those little dots that make up an image on a computer screen. If you want to know the size of your image, open it up in Netscape Navigator. The pixel size appears in the title bar. Here's an example using the following image that measures out at 149 pixels by 140 pixels.
You can 
determine how large your images are by opening them in Navigator.
The code for this image is like this:
<img src="masks.jpg" width="149" height="140" alt="You can determine how large your images are by opening them in Navigator.">


Align Attribute
When you place a graphic on a page it will always appear to the left (that's the default or the standard for the browser). However, you can place it to the right just by adding the align attribute to the image tag. Here's an example of a right alignment:

This is an example of a right-aligned image.




And the code looks like this:
<img src="masks.jpg" align="right" width="149" height="140" alt="This is an example of a right-aligned image.">

Centering an image
But what if you want to center an image. The best way is to use the paragraph tag with the center attribute. Here's an example:

This is an 
example of a centered image.
And here's the code:
<p align="center"><img src="masks.jpg" align="center" width="149" height="140" alt="This is an example of a centered image."></p>


Image Hotspots
Instead of using text as a link (hotspot), it's very common to use an image. It's simple too! Just take include the image tag within the anchor tag.

Here's the code for a link to the Blast-Off page:
<a href-"graphicsc10.html"><img src=atom.jpg width="119" height="120" alt="Take this link to the Blast-Off page" border="0"></a>

And here's the image hotspot. Place your cursor over it and then click.

Take this link 
to the Blast-off Page (7371 bytes)
Notice that there is an extra attribute: border. And I've given it a value of "0". You must add the border attribute if you do not want a border. If you do not list a border, the browser will go to the default, which looks like this:
atom.jpg (7371 
bytes)
You can use an image to serve as an internal link within your own Web site. Another way is to use image maps. To learn more about image maps, go to HTML Goodies.


Download in PDF Format HERE:

Chapter 9: Links down the street to around the world

Sunday, July 18, 2010
Back in 1945, an engineer predicted that someday we would have super computers talking to each other. Today, this vision is a reality through hypertext links (or what others call hyperlinks or just plain links).

Links are the power behind the World Wide Web. Through links, millions of pages, filled with information and knowledge, are only a click away. Every Web site can become a virtual library—a place to learn and grow! And it’s all so very simple to accomplish.

Uniform Resource Locator
Before we get into how to create a hyperlink in HTML, we have to cover some "techy" stuff. Every Web site has an address call the Uniform Resource Locator or URL (pronounced like "earl"). Think of an URL as an address. If you’ve done any Web surfing at all, you have probably used an URL or two. But what does it mean? Let’s examine one more closely:


http:// (hypertext transfer protocol) is a code or what is technically called a protocol that helps one computer talk to another computer. The Internet also has another protocol called FTP (file transfer protocol).

www or world wide web lets the server (the computer) know the file is located on the World Wide Web.

myschool.com is a domain name or where the Web site is hosted.

homework.html is the file or Web page you are seeking.

Hypertext Link
Okay, now that you understand URLs, you’ll find it easier to understand links.
There are two things you need to create a link:
  1. the name of a file or the URL you want to link to
  2. the link hotspot—the highlighted text or graphic that will be clicked on to get to where you want to go.
To create a link in HTML, you need the anchor tag:
<a>…</a>
Inside the tag, you need the attribute: HREF (hypertext reference).
An example of a link looks like this:
Harry uses the browser called
Netscape.
The code looks like this:
Harry uses the browser called
<a href="http//:www.netscape.com">Netscape</a>.

Let's take a closer look at the code:
href.gif (4341 bytes)
Notice that the anchor tag must surround the hotspot and that the attribute HREF must describe where the browser should look for the Web site (the URL).
It's that simple! Now let's look at putting some images on a web page.

Download in PDF Format HERE:

Review #2

Sunday, July 18, 2010
Whew! The past two sections have been chock-full of new stuff to learn. Let’s do a quick review and then, we’ll start  applying what we've learned to a brand new web page.

Attributes are special codes placed inside the HTML tags that describe how the tags will look in the browser.
1. The body tag has three attributes:
BGCOLOR: controls background color
TEXT: controls text color
ALIGN: controls the alignment of text and graphics to the right, center and left
Colors are described in hexadecimal (hex) code, which are six digits or letter that represent a color. Hex codes always begin with a # sign and are placed with quotation marks.
2. Text formatting is the essential ingredient to well designed Web pages.
3. We learned seven new text formatting tags:
  • Font tag: <font>…</font>
  • Bold tag: <b>…</b>
  • Italic tag: <i>…</i>
  • Indented tag: <blockquote>…</blockquote>
  • Small type: <small>…</small>
  • Big type: <big>…</big>
  • Center type: <center>…</center>
4. The font tag has three attributes:
SIZE: controls the size of the type from 1 (smallest) to 7 (largest)
COLOR: controls the color of text
FACE: controls the typestyle


Applying what we've learned.
Now that we've had a bit of a review, let's apply what we have learned so far. We will create an entirely new page to work on.
Mr. Smith, the owner of Cascade Learning Company wants to put one page up on the Web. First he prepares a layout of his page by drawing some ideas on paper.
As you can see, Mr. Smith prepares a simple one-page layout. He decides he wants a nice bright background so he selects a nice yellow from the hexadecimal code: #ffff00. He will also add bold headlines and colorful type. Using the layout as your guide, let's enter the following code:

Step 1 Open up your text editor (SimpleText for Mac or Notepad for Windows).

Step 2 Enter the following :
<html>
<head>
<title>Cascade Learning Company</title>
</head>

<body bgcolor="#fff666">
<font face="Arial, Helvetica">


<p align="center">
<font size="6">Welcome to Cascade Learning Company<br></font>
<i>Where learning can be fun!</i>
</p>

<blockquote>
<p>Hello. I am Mr. Smith, owner of Cascade Learning Company. If you enjoying learning
about different things, you will like my store, located at 11 Main Street in Appleton,
Oregon.</p>
<hr>

<p>
<font color="#0000cc">
<b>For starters, you can select<br>
from a full range of learning games:</b>
</font>

<ol>
<li>Spelling It! </li>
<li>Stick Algebra </li>
<li>How the West Was Won </li>
<li>Find It!</li>
</ol>

<font color="#ff0000">
<p><b>We also have study guides<br>
covering all types of subjects:</b>
</font>

<ul>
<li>Writing </li>
<li>Math </li>
<li>Spelling </li>
<li>Reading </li>
<li>History </li>
<li>Homework</li>
</ul>
<hr>
</blockquote>

<font color="#ff0000">
<h3 align="center">Come visit our store today. </h3></font>

<h3 align="center">Hours</h3>

<p align="center">
Monday through Friday: 10 a.m. to 8 p.m.<br>
Saturday: 10 a.m. to 6 p.m.<br>
Sunday: 12 noon to 4 p.m.<br>
</p>

<h5 align="center">Call us at 555-999-0000</h5>
</font>
</body>
</html>


Step 3 Save the document as: cascade.html

Step 4 Now preview Mr. Smith’s new page in Netscape Navigator, following the steps listed in  

Chapter 4.
If all has gone well, the page should look like this in your browser.
Notice that we used the blockquote tag around all the copy, giving it a wider margin around the sides. There are other ways to do the same thing, but for now, it's an easy and fast way to add margins.

Chapter 8: Advanced text formatting

Sunday, July 18, 2010
The main purpose of the Web is to communicate ideas. It’s been that way from the beginning. In the early days, content was king—meaning, people just used the Web to present thoughts or offer opinions through words. Pictures, clip art, movie clips and even sound weren’t part of the Web yet. Nowadays, the Web has a totally different look and feel.

In fact, the Web has radically changed from its early years. What was once a place that strictly exchanged information is now a place to entertain, sell goods and services, share ideas and especially, learn new things. Designing an inviting page has become an important issue. Now we see tons of graphics, animations, in-the-news movie clips, 3-D computer games and much more. While content is still king, a well designed Web page is now considered equally important—perhaps even the queen.

That brings us to topic at hand: text formatting. Here is where good design begins and fortunately, HTML allows us to do quite a lot with text. There are several tags and attributes to learn, but they all help you—the designer—to create an eye-pleasing page.
In this section, we will cover the following tags and attributes:
  • Font styles: <font>...</font>
  • Bold: <b>...</b>
  • Italic: <i>...</i>
  • Indented text: <blockquote>...</blockquote>
  • Smaller type: <small>...</small>
  • Larger type: <large>...</large>
  • Centered type: <center>...</center>

Font tag*
Not long ago,
Times Roman was the only font you could use with HTML. It is still the font of choice (the default) for the leading browsers. Today, we can choose different font styles as well as several other font options by using the tag:
<font>…</font>
The font tag gives you some control over how your page will look. But unlike other tags discussed so far, the font tag does nothing without an attribute (remember an attribute describes what the tag should do).
We will cover three attributes used with the font tag:
<font size= "#">…</font>
<font face= "type style name">…</font>
<font color= "hex code">…</font>


*A Note to Remember: In the new HTML (version 4.0), the font tag has been deprecated--a big word that means the tag will be dropped in favor of Cascade Style Sheets (CSS). If you would like more information on CSS, please check out the Web site: Style Master to learn more. This changeover--from the font tag to CSS--will happen sometime in the future, but right now many Web sites are still using the font tag. We are in what is called the "transitional period,"  meaning things are still changing.

Font Size
So far, we have learned that the only way to change the size of our text is through the headline tag. But that causes a problem. One, if you use this tag, all the text changes and secondly, you’ll have paragraph breaks before and after the text. So what can you do if you want to change the size of some text within a sentence? Simple, add the attribute size to the font tag. Here’s a coded example:

Learning HTML code <font size=5> does have it’s advantages, </font> especially considering how important the WWW has become.
The resulting line in a browser:
Learning HTML code does have its advantages, especially considering how important the WWW has become.
Notice how the type  increased? You can also decrease your text. Let’s take the same sentence but use size=1.
Learning HTML code does have its advantages, especially considering how important the WWW has become.
By using the size attribute, you can change your text to whatever you like. (By the way, your browser’s default size is number 3.) Here are all seven levels as they would appear in your browser:

font size=1
font size=2
font size=3
font size=4
font size=5
font size=6
font size=7


Font Face
You can also use an attribute that will change the type style of a font. It’s call
face. But a word of caution: the face attribute is system dependent. That is, it will only work if the end user has the same typeface (type style) on his or her system. If not, the browser will automatically go with the default of Times Roman. So what you see on your Netscape or Internet Explorer’s page may not be the same for each user.
So how can prevent this problem? Include more than one type face. For instance, let’s say you want the following text to appear in Arial typeface. This is how you would do it.
<font face="Arial, Helvetica">Selecting type styles can be tricky at times. You must always consider your end user.</font>
Your end result will look like this:
Selecting type styles can be tricky at times. You must always consider your end user.
If the user’s computer did not have Arial, the browser would automatically search for the next typeface mentioned, which in this case is Helvetica. If no such type styles are on the computer, then the browser will go to the default type of Times Roman.
Fortunately Windows® 95 and Macintosh® come with a variety of different typefaces:
Arial
Arial Black
Arial Narrow
Book Antiqua
Bookman Old Style
Century Gothic
Century Schoolbook
Courier New
Garamond
Times New Roman
Verdana


You can specify these typefaces, and the browser will easily find them. However, it’s best to specify more than one typeface, just in case an end user is operating Windows 3.0 or has for some reason, taken one of these typefaces off the computer system.
So how does the attribute look for other type styles?
<font face="bookman old style">
Selecting type styles can be tricky at times. You must always consider your end user.

<font face="arialblack">
Selecting type styles can be tricky at times. You must always consider your end user.
<font face="garamond">
Selecting type styles can be tricky at times. You must always consider your end user.

Font Color
In the last section, we discussed text color as an attribute in the body tag. The text color attribute only permits you to color all the type on your Web page. But what if you want to color only a word or two. Then use the attribute color within the font tag. Here’s an example.

Selecting type styles can be tricky at times. <font color="#0033ff">You should always consider your end user.</font>
This will create text that is bright blue:
Selecting type styles can be tricky at times. You should always consider your end user.
Notice two things here. First of all, the color has been specified in hex code (remember we discussed that in the last lesson). Two, since we did not specify the typeface, the type appeared as Times Roman.


Let's apply what we've learned
Step 1 Load your text editor and open the HTML document we have been working on: firstpage.html

Step 2 Here's how to add some attribute codes to your original HTML file. Enter the code listed below in red.
<html>
<head>
<title>This is my first web page.</title>
</head>

<body bgcolor="#ffff00" text="#000000">
<h1 align="center">Hello world.</h1>
<p align="right"><b>
This is my first web page. There's more to come.</b>
<hr align="center" width="50%">
<p><font size="5" face="arialblack" color="#0033ff">
I am learning how to use the horizontal rule, headline, paragraph and line break tags. Writing HTML isn't as hard as it appears.
</font>
</p>

<p>Here's a list of items I like about school:<br>
Science<br>
Reading<br>
But most of all--recess!<br>

<p>I can also create lists using numbers and bullets. Here is an example of a list with numbers:
<ol>
<li>My first item on the list.</li>
<li>My second item on the list.</li>
<li>My third item on the list.</li>
<li>My fourth item on the list.</li>
</ol>
</p>

</body>
</html>

Here's how it will appear in your browser.
Congratulations, you have just added a new font size, typeface and font color to your Web page!


Other text formatting tags
The other text formatting tags are fairly simple to use and understand.


Bold and Italic tags
To create bold text use: <b>…</b>
To create italicized text use: <i>…</i>

Blockquote
Sometimes you may want to indent a sentence or an entire paragraph. That’s when you’ll want to you the blockquote tag:

<blockquote>…</blockquote>

Small and big tags
To create copy that is slightly smaller than normal:

<small>…</small>
To create copy that is slightly larger than normal:
<big>…</big>

Center tag*
You learned about aligning copy with the align attribute in the last lesson. Fortunately HTML allows us to center text without using an attribute. So when you want to center your copy, it’s simple. Use the following tag:

<center>…</center>
*Please note the center tag is another one that is being replaced in HTML 4.0

Download in PDF Format HERE: