Chapter 3 Lec1
Chapter 3 Lec1
Introduction to HTML
A markup language is a computer language that uses tags to define elements within
a document. It is human-readable, meaning markup files contain standard words,
rather than typical programming syntax. While several markup languages exist, the
two most popular are HTML and XML.
HTML is a markup language used for creating web pages. The contents of each
webpage are defined by HTML tags. Basic page tags, such as <head>, <body>,
and <div> define sections of the page, while tags such as <table>, <form>,
<image>, and <a> define elements within the page. Most elements require a
beginning and end tag, with the content placed between the tags. For example, a
link to the TechTerms.com home page may use the following HTML code
HTML tags
The start tag is also called the opening tag, and the end tag the closing tag.
HTML version
Since the early days of the web, there have been many versions of HTML
Version Year
HTML 1991
HTML.2.0 1995
HTML3.2 1997
HTML 4.01 1999
XHTML 2000
HTML5 2014
Save the file on your computer. Select File > Save as in the Notepad menu.
HTML Headings
<h1> defines the most important heading. <h6> defines the least important heading
HTML paragraphs
Example
<p> HTML stands for Hyper Text Markup Language </p>
Setting the style of an HTML element, can be done with the style attribute.
syntax:
<tagname style="property:value;">
Example
<body style="background-color:powderblue;">
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
HTML Fonts
<h1 style="font-family:verdana;">This is a heading</h1>
<p style="font-family:courier;">This is a paragraph.</p>
HTML Text Size
<h1 style="font-size:300%;">This is a heading</h1>
<p style="font-size:160%;">This is a paragraph.</p>
<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>
Chapter Summary
HTML uses elements like <b> and <i> for formatting output,
like bold or italic text.
HTML Comments
Comment tags are used to insert comments in the HTML source code.
You can add comments to your HTML source by using the following syntax:
Comments are not displayed by the browser, but they can help document your
HTML source code.
HTML Links
Links are found in nearly all web pages. Links allow users to click their way
from page to page.
When you move the mouse over a link, the mouse arrow will turn into a
little hand.
<a href="url">link text</a>
Example
<a href="http://www.w3schools.com/html/">Visit our HTML tutorial</a>
The src attribute specifies the URL (web address) of the image:
<img src="url" alt="some_text" style="width:width;height:height;">
The alt attribute provides an alternate text for an image, If a browser cannot find an
image, it will display the value of the alt attribute.
Example:
<img src="wrongname.gif" alt="HTML5Icon" style="width:128px;height:128px;"
>
You can use the style attribute to specify the width and height of an image.
<img src="html5.gif" alt="HTML5 Icon" width="128" height="128">
the browser expects to find the image in the same folder as the web page.
However, it is common to store images in a sub-folder. You must then include the
folder name in the src attribute:
Example :
<img src="/images/html5.gif" alt="HTML5Icon" style="width:128px;height:128p
x;">
Images on another Server
Actually, you can access images from any web address in the world:
<img src="http://www.w3schools.com/images/w3schools_green.jpg" alt="W3Sch
ools.com">
Chapter Summary