GETTING STARTED WITH HTML Martin Erickson August 28, 2009

The purpose of this introductory guide is to help you begin using HTML, a language in which you can produce wonderful documents for the World Wide Web. The tutorial contains simple examples for you to try. It covers the basics, certainly enough to get you started. To learn more about HTML, you may want to consult the sources listed in Section 7 and in the references that follow. Contents 1. What is HTML? 2. How to create a simple page 3. How to add images to your pages 4. How to add links to your pages 5. How to design your pages 6. How to organize your pages 7. How to learn more References

1

What is HTML?

HTML (Hypertext Markup Language) is a document markup and hyperlink specification language. In a markup language, the layout of a page is specified by elements. In the case of HTML, an Internet browser responds to the elements and shows the pages. As a hyperlink specification language, HTML can be used to link to other documents on the Internet. HTML was introduced by Tim Berners-Lee at the Conseil Europ´eenne pour la Recherche Nucleaire (CERN). The original goal was to provide a communications system for particle physicists to exchange information. The HTML format has proven extremely popular for computer users in general, and is now the standard mark-up language for the World Wide Web.

1

Element html head body title strong em center hn (n = 1, 2, 3, 4, 5, or 6) br p ul ol li

Type structure structure structure information modification modification modification organization organization organization organization organization organization

Use defines document defines head defines body defines title boldfaces text emphasizes text centers text provides header provides new line provides new paragraph provides unordered list provides ordered list provides list element

object

link

provides image, document, etc.

img a

link link

provides image provides page, file, etc.

Attributes

BGCOLOR

data, type width, height src href

Table 1: Basic HTML elements.

2

How to create a simple page

In this section we describe how to create a minimal file, modify text, organize text, and create lists.

A minimal file Certain elements are necessary in every HTML document. Four basic elements are: • html • head • title • body Elements are given by pairs of tags, one to open the element and one to close it. For example, the html element is opened with and closed with . (Tags can be in upper- or lowercase letters.) Some elements may be opened and closed with a single tag, e.g., . In addition, elements can have attributes, i.e., added commands that tailor them for specific situations. Table 1 displays some basic HTML elements, most of which we will discuss in this guide.

2

Figure 1: A simple web page. Example 2.1. We create a minimal page. This and other examples can be created in a simple editor such as Notepad. Files are saved with the extension .html or .htm. My Page Hello everyone! The file (saved as, say, example.html) can be opened with a web browser such as Netscape. The displayed web page is shown in Figure 1.

3

Modifying text At times we wish to change the character of certain text on a page. For example, we may wish to put text in italics or boldface. Italics or emphasized text is obtained with the em element, and boldface with the strong element. • em • strong Example 2.2. We add to the page of Example 2.1. My Page Hello everyone! The web page is shown in Figure 2. Note. You can add some special symbols to your web page with the construction &symbolname;. For example, the string π produces the symbol π. Subscripts can be produced with the and tags, superscripts with the and tags.

Organizing text Text may be organized in an HTML document in a variety of ways. Paragraphs are produced with the p element. Centering is produced with the center element. • p • center Example 2.3. We add some paragraphs to our basic page.

4

Figure 2: A page with modified text. My Page

Hello everyone!

What are some good flavors of ice-cream?

The web page is shown in Figure 3.

Lists Enumerated lists are made with the ol (ordered list) element. Bullet lists are made with the ul (unordered list) element. • ol • ul 5

Figure 3: A page with paragraphs. Example 2.4. We add lists to the page of Example 2.1. My Page

Hello everyone!

Some good flavors of ice-cream:

  • Chocolate
  • Peach
  • Mint
6

Figure 4: A page with a list.

The web page is shown in Figure 4.

3

How to add images to your pages

You can add images to your file with the img element. • img Note. In fact, there exists a more general command, object, with which you can add images, sound, documents, etc. Example 3.1. We add an image to the page of Example 2.1. (This image would need to be available in a directory. You could create it yourself or copy it from another source.) My Page

7

Figure 5: A page with an image.

Hello everyone!

Here is a neat image:

The web page is shown in Figure 5. Note. A word about style. There are many ways to format your HTML code. There are choices about whether to indent or not indent tags, use upper- or lower-case characters (or a mixture), etc. There may not be a best answer, except to choose a style that you like and stick with it.

8

4

How to add links to your pages

Hyperlinks are added with the a element. Type text where address is the address of the link and text is what viewers are to see and “click on” to go to the linked page. • a Note. HTTP stands for “Hypertext Transfer Protocol,” a scheme for telling the browser how to open web pages. This protocol is an example of a scheme. There are schemes for pages, documents, etc. A scheme together with an address is called a URL (Uniform Resource Locator ). Example 4.1. We create a page with links. My Page

Check out the Basin-Robbins page.

And also take a look at the Ben and Jerry’s page.

The page is shown in Figure 6. Note. To use an image as a link, put the address URL of the image between the a tags. The construction is , where the image is image.gif and the link is to http://address.

9

Figure 6: A page with links.

5

How to design your pages

A word about the design of web pages. The most important aspect of web page design is content. You should have something meaningful to present. Following content, the next most important consideration is clarity. Present your pages so that they are easy to read and navigate.

CONTENT + CLARITY

6

How to organize your pages

One popular, and very logical, way to organize your web pages is to follow a directory ordering. A main page has links to several secondary pages, the secondary pages may have links to further pages, and so on. The structure is indicated in the following diagram.

10

level 1 main page @@ R

level 3 page A1

level 2 page A

level 2 page B

@ R @

@ R @

level 3 page A2

level 3 page B1

level 3 page B2

Note. To summarize, in choosing how to organize your pages, you should strive to make it obvious to users how to navigate them and find information.

7

How to learn more

There are many features of HTML that are not discussed in this introduction, such as style sheets and the XML and XHTML generalizations. Here are some resources for you to investigate to learn more. A good introductory book on HTML is [1]. Also, for basics, please look at the sites and . A good intermediate-level book is [3]. If you would like to examine XML, please see [2]. The World Wide Web Consortium (W3C) has a wealth of information on HTML and XML (including a service to validate your code) at . 11

References [1] E. Castro. HTML For the World Wide Web: Visual Quickstart Guide. Peachpit Press, Berkley, fourth edition, 2000. [2] E. Castro. XML For the World Wide Web: Visual Quickstart Guide. Peachpit Press, Berkley, first edition, 2001. [3] A. Navarro and T. Stauffer. HTML by Example. QUE, Indianapolis, first edition, 1999.

12

getting started with html

Aug 28, 2009 - Figure 1: A simple web page. Example 2.1. We create a minimal page. This and other examples can be created in a simple editor such as ...

80KB Sizes 1 Downloads 524 Views

Recommend Documents

Getting Started with Contract4J
are using it on your own risk. Submitting any suggestions, or similar, the ... Go to the Contract4J web-page and download the latest release. In my case it is ... Selecting the JAR files to add to the Contract4J library project's build path.

Getting Started with Contract4J
Go to the Contract4J web-page and download the latest release. In my case it is ... Selecting the JAR files to add to the Contract4J library project's build path.

Getting Started with CodeXL - GitHub
10. Source Code View . ..... APU, a recent version of Radeon Software, and the OpenCL APP SDK. This document describes ...... lel_Processing_OpenCL_Programming_Guide-rev-2.7.pdf. For GPU ... trademarks of their respective companies.

Getting Started with Go - GitHub
Jul 23, 2015 - The majority of my experience is in PHP. I ventured into Ruby, ... Compiled, Statically Typed, Concurrent, Imperative language. Originally ...

Getting Started with Project-Based Learning
and meet the immediate needs of your students rather than being in permanent crisis-mode trying to ... help us master the bigger thing step by step. Through ...

Getting Started with Protege-Frames
Jun 6, 2006 - To create a new project later, select File | New Project.... 2. Click Create ... The internal Protege system classes :THING and .... the left, at the top of the Class Hierarchy area) to delete the class, and then clicking on :THING and.

Getting Started with Transact-SQL Labs - GitHub
The SQL Server Database Engine is a complex software product. For your systems to achieve optimum performance, you need to have a knowledge of Database Engine architecture, understand how query design affects performance, and be able to implement eff

Getting Started with Transact-SQL Labs - GitHub
An online video presentation. • A hands-on ... prerequisite software or making any required configuration changes. ... comfortable configuring service accounts).

Getting Started with MediaFire.pdf
Page 3 of 8. Page 3 of 8. Getting Started with MediaFire.pdf. Getting Started with MediaFire.pdf. Open. Extract. Open with. Sign In. Main menu. Page 1 of 8.

Getting Started with Transact-SQL Labs - GitHub
Create a list of all customer contact names that includes the title, first name, middle ... Customers may provide adventure Works with an email address, a phone ...

Getting Started with Transact-SQL Labs - GitHub
challenges in the Lab Solution folder for this module. ... and customer ID. ... Note: Support for Sequence objects was added to Azure SQL Database in version 12 ...

Getting Started with Transact-SQL Labs - GitHub
In this lab, you will use SELECT queries to retrieve, sort, and filter data from the AdventureWorksLT database. Before starting this lab, you should view Module 2 ...

Getting Started With LATEX
The enumerate environment is opened with a \begin{enumerate} command and closed with an \end{enumerate} command. Within the environment, each item to be enumerated is preceded by an \item command. Highlighted text. Boldfaced text is produced with a \

Getting Started with Transact-SQL Labs - GitHub
SQL Database, a cloud-based relational database service. This is the .... Page 5 .... local network or computer that's preventing the connection. If you're using a ...

Getting Started with LATEX
LATEX is a computer program for typesetting documents. It takes a ..... within the text of a paragraph one should place a $ sign before and after the formula,.

Getting Started with Google AdWords
Google AdWords is an online advertising program that allows anyone to advertise on. Google.com and its network of partner websites. You can use text, image, ...