HTML
HTML
HTML is the set of markup symbols or codes inserted in a file intended for
display on a World Wide Web browser page. The markup tells the VWeb browser how to
display a Web page's words and images for the user. Each individual markup code is
referred to as an element (but many people also refer to it as a tag). Some elements
come in pairs that indicate when some display effect is to begin and when it is to end.
HyperText is the method by which you move around on the web by clicking on
special text called hyperlinks which bring you to the next page.
" Markup is what HTML tags do to the text inside them. They mark it as a certain
type of text (italicized text, for example).
" HTML is a Language, as it has code-words and syntax like any other language.
2 Types of Tags
1. Container Tag- always wraps around text or graphics and comes in a set with an
opening and a closing tag.
The forward slash () on the closing tag tells the browser that the tag has ended.
2. Empty Tag - An empty tag is a term used in web programming to refer to a
starting tag which does not have an ending tag.
H1 gives the biggest, hÓ gives the smallest. Try them out to see
which suits any given application. Within this tag, the attribute
align= can be set to left, center, or right. For example: <h3
align="center"> </h3> centers the header.
<p> Starts a new paragraph: a blank line followed by a new line. You
should use the </p> tag to end the paragraph, but it isn't
necessary.
<br> or <br /> Starts a new line without a blank line in between.
<b> <b> Bold face any text between the tags.
<i> <i> Italic face any text between the tags.
<u> </u> Underline any text between the tags. Not widely used, because
most underlined text on HTML pages is hyperlinks
<Sup> </sup> Supersap. any text between the tags.
<sub> </sub> Subsctipt any text between the tags.
<tt> </tt> Any text between the tags is uniformly spaced: good for aligning
columns.
<hr Draws a horizontal line. The attribute size="50%" (any percent will
do) draws a line of that percentage of the screen width. The
attribute align= can be used to move the line to left, center, or right.
<pre> </pre> Text between these
tags is "preformatted". Spaces and line breaks
appear as you entered
them.
Lists
<ul> /ul> Begin and end an un-numbered list. Each individual item on the list
begins with <li> and ends with <li>, Each item appears as a bullet
point. list
<ol> </o> Begin and end a numbered list. Each individual item on the
begins with <li> and ends with </i>.
Insert Image
Insert the image file: jpg, -gif, or .png files are supported by nearly
<img "tool tips"
src="filename" allbrowsers. The title attribute is displayed by the
mouse over the image.
title="text"> function of the browser: when you run the
Case sensitive
lowercase or
sensitive. That means, you can use either
HTML is also not case For consistency, use
either one or the
same as <html>, code in
uppercase. <HTML> is the our purposes, I have written our
mix and match. For
other. It's best not to
lowercase.
<html>
Ghead> The Head </title>
<title>
<ihead>
<body>
The Body
</body>
</html>
HTML Tags
Whatare HTML tags?
HTML tags are used to mark-up HTML elements
HTML tags are surrounded by the two characters <and >
The surrounding characters are called angle brackets
HTML tags normally come in pairs like <b> and </>
The first tag in a paif is the staYt tag, the second tag is the end tag
The text between the start and end tags is the element content
HTML tags are not case sensitive, <b> means the same as <B>
Logical Vs, Physical Tags
In HTML there are both logical tags and physical tags. Logical tags are designed to
describe (to the browser) the enclosed text's meaning. An example of a logical tag is the
<strong> </strong>tag. By placing text in between these tags you are telling the browser
that the text has some greater importance. By default all browsers make the text appear bold
when in between the <strong>and
</strong>tags.
Physical tags on the other hand provide specific instructions on how to display the text
they enclose. Examples of physical tags include:
<b>: Makes the text bold.
<big>: Makes the text usually one size bigger than what's around it.
<i>:Makes text italic.
Physical tags were invented to add style to HTML pages because style sheets were not
around, though the original intention of HTML was to not have physical tags. Rather than
use physical tags to style your HTML pages, you should use style sheets.
HTML Elements
Remember the HTML example from the previous page:
<htm>
<head>
<title>My First Webpage</title>
<head>
<body>
This is my first homepage. <b>This text is bold</b>
</body>
<html>
The purpose of the <b>tag is to define an HTML element that should be displayed
as bold. This is also an HTML element:
<body>
This is my first homepage. <b>This text is bold<b>
<body>
This HTML element starts with the start tag <body>,and ends with the end tag </body>. The
purpose of the <body>tag is to define the HTML element that contains the body of the
HTML document.
Nested Tags
You may have noticed in the example above, the <body>tag also contains other tags, like
the <b>tab. When you enclose an element in with multiple tags, the last tag opened should
be the first tag closed. For example:
Every HTML document begins and ends with the <html> tag. This tells the browser that
the following document is an htrnl file. Remember, tags tell the browsers how to display
information.
<head>...</head>
The <head> tag contains the title of the document along with general information about
the file, like the author, copyright, keywords and/or a description of what appears on the
page.
<title>..<ititle>
Appears within the <head> tag and gives the title of the page. Try to make your titles
descriptive, but not more than 20 words in length. The title appears at the very top of the
browser page on the title bar.
<body>...</body>
The main content of your page is placed within the body tags: your text, images, links,
tables and so on.
Adding color
When you create a web page you willwant to use different background and text
colors and to add images. This makes the site more attractive to visitors and generally
makes the website look better. Take care not to make the text and background color the
same!
In this exercise we willchange the background color of your welbsite you created
to blue. To do this you would add the following HTML code into the body of your text
file.
<body bgcolor = "#0000FF">
Notice how instead of saying <body bgcolor = blue> We have used some strange
ooking code. Don't worry this is called "Hexadecimal color and can be used for
nserting complex colors into your website.
bther sample of Hexadecimal color codes
FFF COC 999 666 333 000 FFC FF9 FF6 FF3 sWITCH TO DECIMAL RGB
FFF CCc 999 666 333 000C0o 900 600 300 COLOR CODEs
As well as using the Hexadecimal method, you can also use good old-fashioned
English! Meaning that placing the following code into your HTML file would have the
xact same effect:
<body bgcolor = "blue">
2 uy 0wn Homne Page
Fle Edt Vew
Microsofl Internet Explorer
Favorkes Toos Help
Eack
Search Favortes
ddess elcpocuments and SettingsiDanDesktopiogt.html
Google Search Web 3tochedA Zopions
1m our-N ame dthis iN yWveb Pagel
Adding color to text is the same way in adding background color. This is the code
we need to insert into our webpage:
<html>
<head>
<title>My Own Home Page <title>
<head>
<body>
<body bgcolor= "blue">
<font color="Red">
<H1>lamYour-Name and this is my web Page!</H1>
</font>
</body>
IMPORTANT TIP: A common error when coding with colors and HTML in general are
simple spelling mistakes. Remember that when typing "color" it is the American spelling.
make sure you don't use the English spelling "colour" or your HTML won 't work.