Introduction to HTML




What is HTML?

HTML is the standard markup language for creating Web pages. HTML stands for HyperText Markup Language. "Markup language" means that, rather than using a programming language to perform functions, HTML uses tags to identify different types of content and the purposes they each serve to the webpage.

HTML versions

Version Year
HTML 1991
HTML2.0 1995
HTML3.2 1997
HTML4.01 1999
XHTML 2000
HTML5 2014

HTML Page Structure

There are always two parts to an HTML file: the head and the body.
				<!DOCTYPE html>
				<html>
				<head>
					<title></title>
				</head>
				<body>

				</body>
				</html>
		

Pay attention to...

HTML Element

An HTML element is defined by a start tag , some content, and an end tag :
			<tagname> Content goes here... </tagname>
		
Start tag Element content End tag
<h1> My First Heading </h1>
<p> My first paragraph </p>

HTML Headings




HTML Paragraphs

HTML paragraphs are defined with the <p> </p> tag:
			<p> This is a paragraph. </p>
		

Pay attention to...


HTML Comment

HTML Comment are defined with the <!-- and --> tag:
			<!-- Comments here. -->
		

HTML attributes

Example

1. The title attribute for <p></p>:
			<p title="our course name">CSCI 4410 Web Technologies</p>
		
move your cursor above this paragraph:

CSCI 4410 Web Technologies

2. The href attribute for HTML link tag <a></a>:
		<a href="https://lecture.yangxinmtsu.repl.co/4410.html">CSCI 4410 Course Link</a>
		
3. The src attribute for HTML image tag <img>:
				<img src="image_name.jpg">
		

HTML Hyperlink

HTML links are defined with the <a> </a> tag:
		<a href="https://lecture.yangxinmtsu.repl.co/4410" target="_blank">CSCI 4410 Course Link</a>
		

target attribute

Value Description
_blank Load in a new window
_self Load in the same frame as it was clicked
_parent Load in the parent frameset
_top Load in the full body of the window

Create a bookmark


	<h1 id="top">This is the top.</h1>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
	<p>This is a paragraph.</p>
  <a href="#top">Go to the top.</a>
		

HTML Images

		<img src="mtsu.png" alt="MTSU Campus" width="200px" height="400px">
		

more on src attribute

HTML Lists

Unordered lists




Ordered list




Nested lists


	<ol type="1">
		<li>Coffee</li>
			<ul>
				<li>Espresso</li>
				<li>Cappuccino</li>
			</ul>
		<li>Tea</li>
		<li>Milk</li>
	</ol>
		


HTML Table

Modern Table Structure: <thead> and <tbody>

HTML Formatting

HTML Bold vs Strong

HTML Italic vs Emphasis

HTML Marked

Examples

<p>This text is normal.</p>

<p><b>This text is bold (style only).</b></p>
<p><strong>This text is strong (important).</strong></p>

<p><i>This text is italic (style only).</i></p>
<p><em>This text is emphasized (meaning).</em></p>

<p><mark>This text is marked.</mark></p>

This text is normal.

This text is bold (style only).

This text is strong (important).

This text is italic (style only).

This text is emphasized (meaning).

This text is marked.


Quick Guideline


Basic HTML Page Structure

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Webpage</title>
</head>
<body>

</body>
</html>

Understanding Meta Tags in HTML

<meta charset="UTF-8">

What it does

This line tells the browser how to display the text characters correctly in your HTML file.

Why it matters


<meta name="viewport" content="width=device-width, initial-scale=1.0">

What it does

This line controls how the webpage is displayed on different screen sizes, especially phones and tablets. This line helps your webpage look correct on phones and tablets.

Why it matters


HTML Editors

HTML tip: use lowercase tags

Indentation is your friend

Indentation really helps make your code more readable!

Process for developing a website

Reference