Welcome to kasot's HTML Tutorial. Here you will learn how the basics of the Hyper Text Markup Language (HTML), so that you may make your own web pages like the one you are viewing right now.
HTML is not a programming language, but rather a markup language. If you already know XML, then HTML will be a snap for you to learn. We urge you not to attempt to blow through this tutorial in one sitting. We recommend that you spend 15 minutes to an hour a day practicing HTML and then take a break, to let the information settle in. We aren't going anywhere!
Preparation for HTML
Creating an HTML document is easy. To begin coding HTML you need only two things: a simple-text editor and the dedication to follow our tutorial! Notepad is the most basic of simple-text editors and you will probably code a fair amount of HTML with it.
If you are new to HTML and haven't read through the Beginner's Tutorial, please take a few minutes to complete that tutorial before moving on.
Brief HTML Background
HTML has not been around for many years. November 1990 marks the day of the first web page and back then there were little to no HTML standards to be followed. A group called the World Wide Web Consortium was then formed and have since set the standards that are widely accepted and we will base our teachings around them.
Web Pages
Web pages have many uses. Here are some important facts about why web pages are so useful.
* A cheap and easy way to spread information to a large audience.
* Another medium to market your business.
* Let the world know about you with a personal website!
Words to Know
* Tag - Used to specify ("mark-up") regions of HTML documents for the web browser to interpret. Tags look like this:
* Element - A complete tag, having an opening
* Attribute - Used to modify the value of the HTML element. Elements will often have multiple attributes.
For now just know that a tag is a command the web browser interprets, an element is a complete tag, and an attribute customizes or modifies HTML elements.
The Rest of the Tutorial
For the rest of the tutorial, you may use the menu to navigate to specific lessons, or you can continue to learn step-by-step using the "Continue" button below. Examples and "walk-throughs" are provided in each section.
HTML Elements
HTML elements exist on many levels. Everything you see in front of you, the paragraph texts, the Tizag banner, and the navigation links on the left are all elements of this web page. An element in HTML is a loose term that describes each individual piece of your web page.
An element consists of three basic parts: an opening tag, the element's content, and finally, a closing tag.
1.
- opening paragraph tag
2. Element Content - paragraph words
3.
Every (web)page requires four critical elements: the html, head, title, and body elements.
The Element...
begins and ends each and every web page. Its sole purpose is to encapsulate all the HTML code and describe the HTML document to the web browser. Remember to close your HTML documents with the corresponding tag at the bottom of the document.
If you haven't already, open up Notepad or Crimson Editor and have a new, blank document ready to go. Copy the following HTML code into your text editor.
HTML Code:
Now save your file by Selecting Menu and then Save. Click on the "Save as Type" drop down box and select the option "All Files". When asked to name your file, name it "index.html", without the quotes. Double check that you did everything correctly and then press save. Now open your file in a new web browser so that you have the ability to refresh your page and see your changes.
If you opened up your index.html document, you should be starring at your very first blank (white) web page!
The Element
The element is "next" as they say. As long as it falls somewhere between your tag and your web page content (), you're golden. The head functions "behind the scenes." Tags placed within the head element are not directly displayed by web browsers. We will be placing the
Other elements used for scripting (Javascript) and formatting (CSS) will eventually be introduced and you will have to place them within your head element. For now, your head element will continue to lay empty except for the title element that will be introduced next.
Here's a sample of the initial set up.
HTML Code:
As of yet, we still have nothing happening on the web page. All we have so far is a couple of necessary elements that describe our document to the web browser. Content (stuff you can see) will come later.
The
Place the
HTML Code:
Save the file and open it in your browser. You should see "My WebPage!" in the upper-left, as the window's title.
Name your webpage as you please, just keep in mind, the best titles are brief and descriptive.
The
The element is where all content is placed. (Paragraphs, pictures, tables, etc). As the menu on the left suggests, we will be looking at each of these elements in greater detail as the tutorial progresses. For now, it is only important to understand that the body element will encapsulate all of your webpage's viewable content.
HTML Code:
Hello World! All my content goes here!
Go ahead and view your first, complete webpage.
Beginning HTML Tags!
A web browser reads an HTML document top to bottom, left to right. Each time the browser finds a tag, it is displayed accordingly (paragraphs look like paragraphs, tables look like tables, etc). Tags have 3 major parts: opening tag(s), content(s), and closing tag(s). Recall that a completed tag is termed an element. By adding tags to an HTML document, you signal to the browser "Hey look, I'm a paragraph tag, now treat me as such."
As you will learn, there are probably hundreds of HTML Tags. Tables, images, lists, forms, and everything else being displayed on an web page requires the use of a tag or two.
HTML Code:
A Paragraph Tag
Tags should be lower-case letters if you plan on publishing your work. This is the standard for XHTML and Dynamic HTML. Here's quick look at some HTML tags.
HTML Tags:
Body Tag (acts as a content shell)
Paragraph Tag
Heading Tag
Bold Tag
Italic Tag
Tags Without Closing Tags
There are a few tags that do not follow the mold above. In a way, they still have the 3 parts (opening/closing and content). These tags however do not require a formal but rather a modified version. The reason being that these tags do not really require any content. Rather some of them just need a source URL and this is enough information for the web browser to display the tag properly (image tags). Let's take a look at a line break tag.
HTML Code:
To tell the browser we want to place a line break (carriage return) onto the site, it is not necessary to type
linebreak. If every line break tag needed all three components as other do, life would become redundant real quick. Instead the better solution was to combine the opening and closing tags into a single format. Other tags have also been modified such as the image tag and input tag.
HTML Code:
-- Image Tag
-- Line Break Tag
-- Input Field
Display:
--Line Break--
As you can see from the above image tag, your browser is completely capable of interpreting this tag so long as we tell the browser where the image is located using the src attribute. More on attributes in the next lesson.
HTML - Attributes
Attributes are used to amplify tags. What we mean by amplify is that when a web browser interprets a tag, it will also search for set attributes and then display the element (tags+attributes) in its entirety. At some point you may want to give your body element a background color or perhaps change the width of a table. All of these things and more can be achieved using Attributes.
Many HTML tags have a unique set of their own attributes. These will be discussed as each tag is introduced throughout the tutorial. Right now we want to focus on a set of generic attributes that can be used with just about every HTML Tag in existence.
Attributes are placed within the opening tag and they follow a precise syntax (format).
HTML - Class or ID Attribute
The class and id attributes are nearly identical. They play no direct role in formatting your elements but rather serve behind the scenes for scripting and Cascading Style Sheets (CSS). The role of classification and identifying elements will become more apparent as your learn CSS.
The idea is that you can classify or id certain a tag and later format the tag using Cascading Style Sheets. It becomes necessary when you have two or more of the same element on a page (like a
tag) but want them to be different in appearance.
HTML Code:
Paragraph type 1 Italics
Paragraph type 2 Bold
Classification Attributes:
Paragraph type 1 Italics
Paragraph type 2 Bold
HTML - Name Attribute
Name is much different than id and class. By allotting a name to an element, that name becomes a scripting variable for scripting languages such as Javascript, ASP, and PHP. The name attribute is seen most often with forms and other user-input elements.
HTML Code:
The Name Game:
This attribute has no effect on the display of the text field, but behind the scenes it plays a huge identification role.
HTML - Title Attribute
This is a neat little perhaps, forgotten attribute. This attribute titles an element and adds a tiny text pop-up to any HTML element. Much like the text pop-ups of word processing programs, these attributes should not be forgotten. You may title an element anything you would like, the effects of this attribute are not seen until you hover your mouse over the element for a few seconds.
HTML Code:
Titled Heading Tag
Title Attribute:
Titled Heading Tag
Hover your mouse over the display heading to see the magic of the title attribute! This provides your web site with some user interaction which is priceless. Do not overlook the title attribute.
HTML - Align Attribute
If you wish to change the horizontal location of your elements you may do so using the align attribute. You may align things left, right, or center. By default most elements are automatically aligned left unless otherwise specified.
HTML Code:
Centered Heading
Display:
Centered Heading
HTML Code:
Left aligned heading
Centered Heading
Right aligned heading
Display:
Left aligned heading
Centered heading
Right aligned heading
Attribute Defaults
Many tags are assigned default attributes. This means that unless a tag attribute is specified by you the creator, it will have some distinct attributes. For example, a paragraph tag will always align its text to the left unless it has an align attribute in it specifying otherwise. Also elements placed within a table are vertically centered and to the left unless otherwise specified. As you code and learn about each of the different HTML elements, you will become aware of many of these defaults.
Generic Attributes
Attributes exist to modify HTML tags allowing for complete customization of a website. Here's a table of some other attributes that are readily usable with many of HTML's tags.
Attribute Options Function
align right, left, center Horizontally aligns tags
valign top, middle, bottom Vertically aligns tags within an HTML element.
bgcolor numeric, hexidecimal, RGB values Places a background color behind an element
background URL Places an background image behind an element
id User Defined Names an element for use with Cascading Style Sheets.
class User Defined Classifies an element for use with Cascading Style Sheets.
width Numeric Value Specifies the width of tables, images, or table cells.
height Numeric Value Specifies the height of tables, images, or table cells.
title User Defined "Pop-up" title for your elements.
Paragraph Tag
Publishing any kind of written works requires the use of a paragraph. The paragraph tag is very basic and a great introductory tag for beginner's because of its simplicity.
The
tag defines a paragraph. Using this tag places a blank line above and below the text of the paragraph. These automated blank lines are examples of how a tag "marks" a paragraph and the web browser automatically understands how to display the paragraph text because of the paragraph tag.
HTML Code:
Avoid losing floppy disks with important school...
For instance, let's say you had a HUGE school...
Two HTML Paragraphs:
Avoid losing floppy disks with important school/work projects on them. Use the web to keep your content so you can access it from anywhere in the world. It's also a quick way to write reminders or notes to yourself. With simple html skills, (the ones you have gained so far) it is easy.
For instance, let's say you had a HUGE school or work project to complete. Off hand, the easiest way to transfer the documents from your house could be a 3.5" floppy disk. However, there is an alternative. Place your documents, photos, essays, or videos onto your web server and access them from anywhere in the world.
HTML - Paragraph Justification
Paragraphs can be formatted in HTML much the same as you would expect to find in a word processing program. Here the align attribute is used to "justify" our paragraph.
HTML Code:
For instance, let's say you had a HUGE school or work...
Justified Text Alignment:
For instance, let's say you had a HUGE school or work project to complete. Off hand, the easiest way to transfer the documents from your house could be a 3.5" floppy disk. However, there is an alternative. Place your documents, photos, essays, or videos onto your web server and access them from anywhere in the world.
HTML - Paragraph Centering
HTML Code:
For instance, let's say you had a HUGE school or work...
Centered Text Alignment:
For instance, let's say you had a HUGE school or work project to complete. Off hand, the easiest way to transfer the documents from your house could be a 3.5" floppy disk. However, there is an alternative. Place your documents, photos, essays, or videos onto your web server and access them from anywhere in the world.
Each line of the paragraph has now been centered inside the display window.
HTML - Paragraph Align Right
HTML Code:
For instance, let's say you had a HUGE school or work...
Right Text Alignment:
For instance, let's say you had a HUGE school or work project to complete. Off hand, the easiest way to transfer the documents from your house could be a 3.5" floppy disk. However, there is an alternative. Place your documents, photos, essays, or videos onto your web server and access them from anywhere in the world.
Every line of the paragraph above is now aligned to the right hand side of the display box.
HTML - Headings 1:6
A heading in HTML is just what you might expect, a title or subtitle. By placing text inside of
(heading) tags, the text displays bold and the size of the text depends on the number of heading (1-6). Headings are numbered 1-6, with 1 being the largest heading and 6 being the smallest.
HTML Code:
Headings
are
great
for
titles
and subtitles
Place these lines into your HTML file and you should get what is displayed below.
Headings 1-6:
Headings
are
great
for
titles
and subtitles
Notice that each heading has a line break before and after each heading display. This is a built in attribute so to speak associated with the heading tag. Each time you place a heading tag, your web browser automatically places a line break in front of your beginning tag and after your ending tag exactly the same as with
tags.
Essay Walkthrough
Let's tie together headings and paragraphs to form an essay. Copy(Highlight, then Ctrl C) or code the following in the body of your page or a new page. Or make your own essay paragraphs.
HTML Code:
Essay Example
Avoid losing floppy disks with important school/work projects...
For instance, let's say you had a
HUGE school or work project to complete. Off ...
HTML Essay:
View the page in a new window.
Line Breaks
Line breaks are different then most of the tags we have seen so far. A line break ends the line you are currently on and resumes on the next line. Placing
within the code is the same as pressing the return key in a word processor. Use the
tag within the
(paragraph) tag.
HTML Code:
Will Mateson
Box 61
Cleveland, Ohio
Address:
Will Mateson
Box 61
Cleveland, Ohio
We have created a possible address for a letter head. The line break tag will also come in handy toward the end of our letter.
HTML Code:
Sincerely,
Kevin Sanders
Vice President
Closing Letter:
Sincerely,
Kevin Sanders
Vice President
HTML Horizontal Rule
Use the
tag to display lines across the screen. Note: the horizontal rule tag has no ending tag like the line break tag.
HTML Lists
There are 3 different types of lists. A
- tag starts an ordered list,
- (list item) tag between your opening
- and closing
HTML Code:
Goals
- Find a Job
- Get Money
- Move Out
Numbered list:
Goals
1. Find a Job
2. Get Money
3. Move Out
Start your ordered list on any number besides 1 using the start attribute.
HTML Code:
Goals
- Buy Food
- Enroll in College
- Get a Degree
Numbered List Start:
Goals
4. Buy Food
5. Enroll in College
6. Get a Degree
Nothing fancy here, start simply defines which number to begin numbering with.
HTML Ordered Lists Continued
There are 4 other types of ordered lists. Instead of generic numbers you can replace them with Roman numberals or letters, both capital and lower-case. Use the type attribute to change the numbering.
HTML Code:
- Milk
- Toilet Paper
- Cereal
- Bread
- - definition term
* - - defining definition
HTML Code:
- Fromage
- French word for cheese.
- Voiture
- French word for car.
HTML Code:
Fromage
French word for cheese.
Voiture
French word for car.
Bookmark and Share
HTML - Formatting Elements w/ Tags
As you begin to place more and more elements onto your web site, it will become necessary to make minor changes to the formatting of those elements. In our HTML Attributes lesson we discussed ways to add some flavor with attributes and align elements within other elements. Several tags exist to further amplify text elements. These formatting tags can make text bold, italic, sub/superscripted, and more.
Advertise on Tizag.com
Bold, Italic and More
HTML Code:
An example of Bold Text
An example of Emphasized Text
An example of Strong Text
An example of Italic Text
An example of superscripted Text
An example of subscripted Text
An example of
struckthrough TextAn example of
Computer Code Text
HTML Formatting:
An example of Bold Text
An example of Emphasized Text
An example of Strong Text
An example of Italic Text
An example of superscripted Text
An example of subscripted Text
An example of struckthrough Text
An example of Computer Code Text
All of these tags add a pinch of flavor to paragraph elements. They can be used with any text type element.
HTML - Formatting Tag Usage
These tags should be used sparingly. And what we mean by that is that you should only use them to bold or italicize one or two words in your elements at a time. If you wish to bold an entire paragraph a better solution would involve Cascading Style Sheets, and you should consult how to do that in our CSS Tutorial. Ultimately the decision is yours, the web developer. Being a voice of experience, keep the use of these tags quick and sparse.
Bookmark and Share
* Go Back
* Continue
Tips
* Remember that there is a special form for line breaks and horizontal rule tags.
* Use this page as a reference if you ever need to format your web site's text in the future.
Found Something Wrong in this Lesson?
Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!
Bold, Italic and More
HTML Code:
An example of Bold Text
An example of Emphasized Text
An example of Strong Text
An example of Italic Text
An example of superscripted Text
An example of subscripted Text
An example of
struckthrough TextAn example of
Computer Code Text
HTML Formatting:
An example of Bold Text
An example of Emphasized Text
An example of Strong Text
An example of Italic Text
An example of superscripted Text
An example of subscripted Text
An example of struckthrough Text
An example of Computer Code Text
All of these tags add a pinch of flavor to paragraph elements. They can be used with any text type element.
HTML - Formatting Tag Usage
These tags should be used sparingly. And what we mean by that is that you should only use them to bold or italicize one or two words in your elements at a time. If you wish to bold an entire paragraph a better solution would involve Cascading Style Sheets, and you should consult how to do that in our CSS Tutorial. Ultimately the decision is yours, the web developer. Being a voice of experience, keep the use of these tags quick and sparse.
HTML Color Coding System - Color Names
There are 3 different methods to set color. The simplest being the Generic terms of colors. Examples: black, white, red, green, and blue. Generic colors are preset HTML coded colors where the value is simply the name of each color. Here is a sample of the most widely supported colors and their respective name values.
The 16 Basic Colors:
Black Gray Silver White
Yellow Lime Aqua Fuchsia
Red Green Blue Purple
Maroon Olive Navy Teal
HTML Coloring System - RGB Values
We do not recommend that you use RGB for safe web design because non-IE browsers do not support HTML RGB. However, if you plan on learning CSS then you should glance over this topic.
RGB stands for Red, Green, Blue. Each can have a value from 0 (none of that color) to 255 (fully that color). The format for RGB is - rgb(RED, GREEN, BLUE), just like the name implies. Below is an example of RGB in use, but if you are not using a browser that supports it, do not worry, that is just one of the problems with HTML RGB.
Red, Green, and Blue Values:
bgcolor="rgb(255,255,255)" White
bgcolor="rgb(255,0,0)" Red
bgcolor="rgb(0,255,0)" Green
bgcolor="rgb(0,0,255)" Blue
HTML Coloring System - Hexadecimal
The hexadecimal system is complex and difficult to understand at first. Rest assured that the system becomes much, MUCH easier with practice and as a blossoming web developer, it is critical to understand hexadecimals to be capable of using them in your own web publications. They are far more reliable and widely compatible among web browsers and are the standard for colors on the internet.
A hexadecimal is a 6 digit representation of a color. The first two digits(RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB).
Here's a hexadecimal you might see in an HTML document.
My First Hexadecimal:
bgcolor="#RRGGBB"
HTML Color Code - Breaking the Code
The following table shows how letters are incorporated into the hexadecimal essentially extending the numbers system to 16 values. Hang in there it all makes sense shortly.
Hexadecimal Color Values:
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F
So use letters as numbers?We will answer this question as we dive into the converting hexadecimals to regular numbers. Let's have a look at real Hexadecimal.
A Real Hexadecimal:
bgcolor="#FFFFFF"
The letter "F" is the maximum amount we can send each color and as you may deduce, this color (#FFFFFF) represents the color white. A formula exists to calculate the numeric equivalent of a hexadecimal.
Hexadecimal Formula:
(15 * 16) + (15) = 255
The formula is real simple. Take the first value (F) or 15 multiply it by 16 and add it to the second value, 15. The value 255 is the maximum allowed for any primary color.
Let's try another one.
Example 2:
bgcolor="#CC7005"
CC(RR - Red)
(12 * 16) + (12) = 204
70(GG - Green)
(7 * 16) + (0) = 112
05(BB - Blue)
(0 * 16) + (5) = 5
Hexadecimals are the best choice for compatible web development because of their consistency between browsers. Even the most minor of change in color can throw your entire site out of whack, so be sure to check your site in a number of browsers. If you want to be absolutely sure your colors will not change, use paired hex values for color. Examples: "#0011EE", "#44HHFF", or "#117788". These are called True Colors, since they will stay true in hue from browser to browser.
HTML - Font and Basefont
The tag is used to add style, size, and color to the text on your site. Use the size, color, and face attributes to customize your fonts. Use atag to set all of your text to the same size, face, and color.
The font and basefont tags are deprecated and should not be used. Instead, use css styles to manipulate your font. See our CSS Tutorial for more information.
Font Size
Set the size of your font with size. The range of accepted values is from 1(smallest) to 7(largest).The default size of a font is 3.
HTML Code:
Here is a size 5 font
Font Size:
Here is a size 5 font.
Font Color
Set the color of your font with color.
HTML Code:
This text is hexcolor #990000
This text is red
Font Color:
This text is hexcolor #990000
This text is red
Font Face
Choose a different font face using any font you have installed. Be aware that if the user viewing the page doesn't have the font installed, they will not be able to see it. Instead they will default to Times New Roman. An option is to choose a few that are similar in appearance.
HTML Code:
This paragraph
has had its font...
Font Face:
This paragraph has had its font formatted by the font tag!
Basefont - Set a Solid Base
With the basefont tag you will be able to set the default font for your web page. We highly recommend specifying a basefont if you plan on using any font with HTML. Below is the correct way to set your basefont.
HTML Code:
This paragraph has had its font...
This paragraph has had its font...
This paragraph has had its font...
Base Font:
This paragraph has had its font formatted by the basefont tag!
This paragraph has had its font formatted by the basefont tag!
This paragraph has had its font formatted by the basefont tag!
However, the use of basefont is deprecated, which means it may not be supported sometime in the future. The perfectly correct way to change your sites basefont is to set it with CSS. Check out our CSS Tutorial for more information.
Attribute Review
Attributes:
Attribute= "Value" Description
size= "Num. Value 1-7" Size of your text, 7 is biggest
color= "rgb,name,or hexidecimal" Change font color
face= "name of font" Change the font type
Beautiful First Letter Style
Customize your fonts to achieve any of your desired looks.
HTML Code:
Customize
your font to achieve a desired look.
Beauty:
Customize your font to achieve a desired look.
HTML - Links and Anchors
The web got its spidery name from the plentiful connections between web sites. These connections are made using anchor tags to create links. Text, Images, and Forms may be used to create these links.
HTML - Hypertext Reference (href)
The href attribute defines reference that the link refers to. Basically this is where the user will be taken if they wish to click this link.
Hypertext references can be Internal, Local, or Global.
* Internal - Links to anchors on the current page
* Local - Links to other pages within your domain
* Global - Links to other domains outside of your site
HTML Code:
Internal - href="#anchorname"
Local - href="../pics/picturefile.jpg"
Global - href="http://www.tizag.com/"
HTML - Text Links
Use the tags to define the start and ending of an anchor. Decide what type of href attribute you need and place this attribute into the opening tag. The text you place between the opening and closing tags will be shown as the link on a page. Use the demonstration below as a reference.
HTML Code:
Tizag Home
ESPN Home
Yahoo Home
Global Link:
Tizag Home ESPN Home Yahoo Home
HTML - Link Targets
The target attribute defines whether to open the page in a separate window, or to open the link in the current browser window.
HTML Code:
target=" _blank" Opens new page in a new browser window
_self" Loads the new page in current window
_parent" Loads new page into a frame that is superior to where the link lies
_top" Loads new page into the current browser window, cancelling all frames
The example below shows how you would link to ESPN.COM, a popular sports web site. The target attribute is added to allow the browser to open ESPN in a new window, so that the viewer can remain at our web site. Here's the example.
HTML Code:
ESPN.COM
_blank Target:
ESPN.COM
HTML - Anchors
To link to sections of your existing page a name must be given to the anchor. In the example below, we've created a mini Table of Contents for this page. By placing blank anchors just after each heading, and naming them, we can then create reference links to those sections on this page as shown below.
First, the headings of this page contain blank, named anchors. They look like this.
Tizag's Own Code:
HTML Links and Anchors
HTML Text Links
HTML Email
Now create the reference links, placing the pound symbol followed by the name of the anchor in the href of the new link.
Anchor Code:
Go to the Top
Learn about Text Links
Learn about Email Links
Local Links:
Go to the Top
Learn about Text Links
Learn about Email Links
HTML - Email Links
Creating an email link is simple. If you want somebody to mail you about your site a good way to do it is place an email link with a subject already in place for them.
HTML Code:
Email@tizag.com
Email Links:
Email@tizag.com
In some circumstances it may be necessary to fill in the body of the Email for the user as well.
HTML Code:
Email@tizag.com
Complete Email:
Email@tizag.com
HTML - Download Links
Placing files available for download is done in exactly the same fashion as placing text links. Things become complicated if we want to place image links available for download. The best solution for images is to use a thumbnail link that we discuss in the next lesson.
HTML Code:
Text Document
Download a Text Document:
Text Document
HTML - Default Links; Base
Use thetag in the head element to set a default URL for all links on a page to go to. It's always a good idea to set a base tag just incase your links become bugged somewhere down the line. Usually set your base to your home page.
HTML Code:
HTML Character Entities
An entity is a fancy term for a symbol. Several symbols such as copyright, trademark, or foreign cash symbols exist outside of the ones you see on your keyboard. In order to display them. In order to display these characters, you need to know 4 parts.
There's three parts to every entity.
HTML Code:
* Each begins with a ampersand - &
* Then the entities name - copy
* And finally a semicolon - ;
Copyright:
Combine © to make - © - Copyright symbol.
Expect complications if you forget to include all three parts of an entity.
Additional Spaces and <>.
As you have may have learned within paragraph and heading tags, browsers will only recognize and format 1 space between words reguardless of how many you may actually type in your coded HTML. An entity exists for placing additional spaces.
Here's an example.
HTML Code:
Everything that goes up, must come down!
Spaces:
Everything that goes up, must come down!
In HTML we use less than and greater than characters to create tags, so to use them on your web site you will need entities.
HTML Code:
Less than - <
Greater than - >
Body tag - <body>
Less than Greater than:
Less than - <
Greater than - >
Body tag -
Take a few minutes to view and play with the symbols listed in the Entities Table.
Create HTML Email
Making an HTML email link on your page is quick and simple. However, you should know that when you place your email on your website, it is very easy for computer experts to run programs to harvest these types of emails for spamming. If you are going to put your email link on a public website, be sure that you have anti-spam software!
Another option to allow people to send you emails without exposing yourself to massive amounts of spam is to create an HTML form that gathers data from the user and emails it to your email account. We recommend the HTML Form Email that usually reduces the amount of potential spam.
HTML Email Tag
There actually is not a separate HTML tag for creating an HTML email link. Instead you use a standard HTML anchor tag and set the href property equal to the email adddress, rather than specifying a web URL. This is probably confusing and may take a little while to get used to.
HTML Code:
Email Example
Email Link:
Email Example
Additional HTML Email Code
By adding a couple extra goodies onto the email address in href you can have both the SUBJECT and the BODY of the email automatically populated for your visitors. This is great when receiving emails from a website to an email account that handles more mail than just from that one link on your site.
By defining a uniform subject that people will automatically have when clicking the link you will be able to tell right away whether or not an email came from the website or from another source (as long as your visitors don't mess with the subject that you give them).
* Subject - Populates the subject of the email with the information that you provide.
* Body - Populates the body of the email with the information that you provide.
HTML Code:
2nd Email Example
Complete Email:
2nd Email Example
HTML - Images
Images are a staple of any web designer, so it is very important that you understand how to use them properly. Use the tag to place an image on your web page.
HTML Code:
Image:
HTML - Image src
Above we have defined the src attribute. Src stands for source, the source of the image or more appropriately, where the picture file is located. As with links described in a previous lesson, you may use any standard URL to properly point the src attribute to a local or external source.
There are two ways to define the source of an image. First you may use a standard URL. (src=http://www.Tizag.com/pics/htmlT/sunset.gif) As your second choice, you may copy or upload the file onto your web server and access it locally using standard directory tree methods. (src="../sunset.gif") The location of this picture file is in relation to your location of your .html file.
URL Types:
Local Src Location Description
src="sunset.gif" picture file resides in same directory as .html file
src="../sunset.gif" picture file resides in previous directory as .html file
src="../pics/sunset.gif" picture file resides in the pic directory in a previous directory as .html file
A URL cannot contain drive letters, since a src URL is a relational source interpretation based on the location of your .html file and the location of the picture file. Therefore something like src="C:\\www\web\pics\" will not work. Pictures must be uploaded along with your .html file to your web server.
Each method has its pros and cons, for instance using the URL of pictures on other sites poses a problem if the web master(s) of the other site happen to change the physical location of the picture file. Copying the file directly to your web server solves this problem, however, as you continue to upload picture files to your system, you may eventually run short on hard drive space. Use your best judgement to meet your needs.
HTML - Alternative Attribute
The alt attribute specifies alternate text to be displayed if for some reason the browser cannot find the image, or if a user has image files disabled. Text only browsers also depend on the alt attribute since they cannot display pictures.
HTML Code:
Alternative Text:
Beautiful Sunset
HTML - Image Height and Width
To define the height and width of the image, rather than letting the browser compute the size, use the height and width attributes.
HTML Code:
Height and Width:
Above we have defined the src, height and width attributes. By informing the browser of the image dimensions it knows to set aside a place for that image. Without defining an image's dimensions your site may load poorly; text and other images will be moved around when the browser finally figures out how big the picture is supposed to be and then makes room for the picture.
Vertically and Horizontally Align Images
Use the align and valign attributes to place images within your body, tables, or sections.
1. align (Horizontal)
* right
* left
* center
2. valign (Vertical)
* top
* bottom
* center
Below is an example of how to align an image to the right of a paragraph.
HTML Code:
This is paragraph 1, yes it is...
The image will appear along the...isn't it?
This is the third paragraph that appears...
Image Wrap Arond:
This is paragraph 1, yes it is. I think this paragraph serves as a nice example to show how this image alignment works.
The image will appear along the right hand side of the paragraph. As you can see this is very nice for adding a little eye candy that relates to the specified paragraph. If we were talking about beautiful tropical sunsets, this picture would be perfect. But we aren't talking about that, so it's rather a waste, isn't it?
This is the third paragraph that appears below the paragraph with the image!
Images as Links
This will be a quick review of the links - image lesson. Images are very useful for links and can be created with the HTML below.
HTML Code:
Image Links:
Now your image will take you to our home page when you click it. Change it to your home page URL.
Thumbnails
Thumbnails are small size (Kilobytes) pictures that link to the larger, high quality picture. To make a thumbnail save a low-quality version of a picture and make it have smaller dimensions. Now make this low-quality picture into an image link and have it point to the the high-quality picture.
HTML Code:
Thumbnails:
HTML Gifs vs. Jpegs
Gifs are best used for banners, clip art, and buttons. The main reason for this is that gifs can have a transparent background which is priceless when it comes to web design. On the down side, gifs are usually larger files, not as compressed as a jpeg, which calls for slow load times and large transfer rates. Gifs are also limited to the 256 color scheme.
Jpegs however, have an unlimited color wheel, and have a high compression rate downsizing your load times and saving hard drive space. Jpegs don't allow for transparent backgrounds, but their size/quality ratio is outstanding. Its best to use Jpegs for photo galleries, or artwork to allow the viewer to catch that extra bit of detail. Avoid Jpegs for graphical design, stick to using them for thumbnails and backgrounds.
HTML - Image Links
Using graphics will liven up that tired, bland-looking text link. To make an image link simply insert an image within the anchor tag. If you do not know how to use the image tag, skip ahead to the image tutorial and come back after you feel comfortable with it.
HTML Code:
Image Link:
Notice that by default, many browsers add a small border around image links. This is to quickly deceifer the difference between image links and just ordinary images on a web site. Since this default is different from web browser to web browser it may be best to squelch this ambiguity by setting the border attribute to zero.
HTML Code:
Image Link; No Border:
HTML - Thumbnails
Thumbnails are small size (Kilobytes) pictures that link to the larger, high quality picture. To make a thumbnail save a low-quality version of a picture and make it have smaller dimensions. Now make this low-quality picture into an image link and have it point to the the high-quality picture.
HTML Code:
Thumbnails:
HTML Forms
Forms are a vital tool for the webmaster to receive information from the web surfer, such as: their name, email address, credit card, etc. A form will take input from the viewer and depending on your needs, you may store that data into a file, place an order, gather user statistics, register the person to your web forum, or maybe subscribe them to your weekly newsletter.
Text Fields
Before we teach you how to make a complete form, let's start out with the basics of forms. Input fields are going to be the meat of your form's sandwich. The has a few attributes that you should be aware of.
* type - Determines what kind of input field it will be. Possible choices are text, submit, and password.
* name - Assigns a name to the given field so that you may reference it later.
* size - Sets the horizontal width of the field. The unit of measurement is in blank spaces.
* maxlength - Dictates the maximum number of characters that can be entered.
HTML Code:
Input Forms:
Name:
Password:
Do not use the password feature for security purposes. The data in the password field is not encrypted and is not secure in any way.
HTML Form Email
Now we will add the submit functionality to your form. Generally, the button should be the last item of your form and have its name attribute set to "Send" or "Submit". Name defines what the label of the button will be. Here is a list of important attributes of the submit:
In addition to adding the submit button, we must also add a destination for this information and specify how we want it to travel to that place. Adding the following attributes to your
Email Forms:
Name:
Password:
Simply change the email address to your own and you will have set up your first functional form!
HTML Radio Buttons
Radio buttons are a popular form of interaction. You may have seen them on quizzes, questionnaires, and other web sites that give the user a multiple choice question. Below are a couple attributes you should know that relate to the radio button.
* value - specifies what will be sent if the user chooses this radio button. Only one value will be sent for a given group of radio buttons (see name for more information).
* name - defines which set of radio buttons that it is a part of. Below we have 2 groups: shade and size.
HTML Code:
Radios:
What kind of shirt are you wearing?
Shade: Dark Light
Size: Small Medium Large
If you change the email address to your own and "Email Myself" then you should get an email with "shade=(choice) size=(choice)".
HTML Check Boxes
Check boxes allow for multiple items to be selected for a certain group of choices. The check box's name and value attributes behave the same as a radio button.
HTML Code:
Check Boxes:
Select the 2 greatest toons.
Goofy
Donald
Bugs Bunny
Scooby Doo
HTML Drop Down Lists
Drop down menues are created with the
Ordered List Types:
Lower-Case Letters Upper-Case Letters Lower-Case Numerals Upper-Case Numerals
1. Find a Job
2. Get Money
3. Move Out
1. Find a Job
2. Get Money
3. Move Out
1. Find a Job
2. Get Money
3. Move Out
1. Find a Job
2. Get Money
3. Move Out
HTML Unordered Lists
Create a bulleted list with the- tag. The bullet itself comes in three flavors: squares, discs, and circles. The default bullet displayed by most web browsers is the traditional full disc.
HTML Code:
Shopping List
Unordered Lists:
Shopping List
* Milk
* Toilet Paper
* Cereal
* Bread
Here's a look at the other flavors of unordered lists may look like.
HTML Code:
Unordered List Types:
type="square" type="disc" type="circle"
* Milk
* Toilet Paper
* Cereal
* Bread
* Milk
* Toilet Paper
* Cereal
* Bread
* Milk
* Toilet Paper
* Cereal
* Bread
HTML Definition Term Lists
Make definition lists as seen in dictionaries using the- tag. These lists displace the term word just above the definition itself for a unique look. It's wise to bold the terms to displace them further.
*- - defines the start of the list
*
- for unordered lists, and
- for definition lists. Use the type and start attributes to fine tune your lists accordingly.
HTML Ordered Lists
Use the
- tag to begin an ordered list. Place the
No comments:
Post a Comment