HTML - A Simple overview: [ last updated June 3, 2015]
There are many good HTML tutorials on the web. I plan to go through at least one and I encourage you to do the same.
HTML is used to create web pages that can be viewed across the internet. The process involves a browser on the user's computer ( e.g Chrome or Internet Explorer), a connection to the internet, a "server" computer also connected to the internet, and one or more HTML files stored on the server. For a brief introduction to this process, please read the document reached from clicking this link.
For now I would like to present a very simple overview of HTML that can be used as a base to start working with JavaScript.
HTML - Part 1
The first thing to know is that most web pages are stored as a file containing text (this is the HTML document), and one or more related files (such as JPEG picture files to be displayed in the page).
The next thing I think it's important to know is that HTML was originally intended to be a way of marking up a page of text to tell a program how to display that text on a computer screen. HTML stands for "Hypertext Markup Language". The "mark-up language" is used to set the same kinds of things that we choose when we are creating a document in MS Word : choice of font, font size and color, indentations, outlined tables, etc.
HTML uses codes called "tags" to mark-up the text to be displayed. Each HTML tag is enclosed in angle brackets, e.g. <b>. For example HTML markup tags could be used with the text "Hello Universe"to tell a browser to show that text as bold:
<b>Hello Universe</b>
Many HTML tags are used in pairs to show the beginning and end of some attribute, some examples
<b>Everything between these two tags would be displayed as bold by a browser</b>
<i>Everything between these two tags would be displayed as italic by a browser </i>
Here is a web page with a list of some frequently used HTML tags : http://www.w3schools.com/tags/
HTML - Part 2
An HTML document is normally divided into two main sections, the heading and the body. An empty HTML document would look like this:
<html>
<head>
</head><body>
<body></html>
If the document had a title and one sentence of content it would look like this:
<html>
<head>
<title>Title of this document</title>
</head><body>
One sentence of content in this document
<body></html>
Confession: A web page is not quite that simple. In order for a browser to display a web page it needs to know a little about how it is coded. For example, it needs to know "Does the web page use HTML, and if so, what version?" For that reason the first line in every webpage looks something like this :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The table below contains the HTML documents for two simple web pages. The link in the right column of the table will open up that document in your browser.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <body> </html> |
Click here to see this page on the web | |
| Note: the <p> tag used below calls for a new paragraph. Without it, all five lines of the document would be combined into one line. | ||
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <body> </html> |
Click here to see this page on the web | |
I find it useful to keep in mind the following relationships.
An HTML file can be viewed as a web page/site or as an ASCII text file. An HTML file can be viewed when stored on the same machine as the browser that views it, or when it is stored on a remote web server. An HTML file can be created, and edited on the developer’s local machine and later transferred to a remote web server. Alternatively a web developer can use on-line software to create a web page on a remote computer and then save it to an internet server. Finally, an HTML file can be created and edited, using a text editor or a WYSIWYG web site editor. If you can wrap your mind around all of these possibilities, you are doing well. It’s messy.
The above paragraph is explained in more detail in the document reached from this link.