HTML Tutorials

Tutorial No. 1
HTML
The HTML instructions, along with the text to which the instructions apply, are called HTML elements. The HTML instructions are themselves called tags, and look like <element_name> -- that is, they are simply the element name surrounded by left and right angle brackets.

HTML is a abbreviation of Hyper Text Mark up Language. This is a computer language.Computer language is a way of communication between man and a computer, that tells the computer what men wants.HTML language is very helpful for you to make a web page.
     The big advantage of this language is that there is no need of any software for use of this language. You can use this coding in any text editing software such as Note pad or word pad but Note pad has a greater importance.
HTML coding uses different tags. These tags are consist of symbols ''>'' (greater than) and ''<'' (less than) and tag description are in these symbols, such as title tag is shown as    <title>
It is necessary to close the tag which was opened or  started. For closing of tag slash symbol (  /  ) is used, such as closing tag of title is </title>
Now we will start our first lesson which is a procedure of opening of  Note pad and introduction of basic tags and how we save our work.
Go to start, then go to all programs and accessories, You will get Note pad.
 Click on Note pad, Note pad will be open as shown in following screen shot


After the opening of Note pad you will start HTML coding with html tag. HTML tag means you are using html coding. Other  basic tags are also shown.
<html>
<head>
<title>
LEARN COMPUTER EARN
</title>
</head>
<body>
this is a first tutorial on html. a body of a html coding is a description of title.
</body>
</html>


Now you can save your work.
Go to file and click on save as, a pop up window will appear on screen. write your file name with html extension, such as file name is learn, you will write learn.html. note that html extension is necessary for appearing your work on web browsing

.
After saving your file your file will save on your selected location according to your web browser.


Result of your file on web page is shown as under



Tutorial No. 2

Tags Description


  1. <HEAD> <TITLE>

HTML documents are structured into two parts, the HEAD, and the BODY. Both of these are contained within the HTML element -- this element simply denotes this as an HTML document.
The head contains information about the document that is not generally displayed with the document, such as its TITLE. The BODY contains the body of the text, and is where you place the document material to be displayed. Elements allowed inside the HEAD, such as TITLE, are not allowed inside the BODY, and vice versa.
This Tag is used for your header description. The message at the top of your website will appear  by using this tag while message describes your topic description or title description. Close the tag where you want to finish the effect of title description.

EXAMPLE:-
<HEAD> <TITLE>
LEARN COMPUTER EARN
 </TITLE></HEAD>
2   <BODY>
Now you will write all the html coding in this body tag along with all relevant html tags. I will describe relent tags in incoming tutorials.
EXAMPLE:-
<BODY>
In this web site you will learn different computer tutorials such as creating a blog, google adsense, MS word, MS excel, Photoshop, corel draw etc. So keep in touch with LEARN COMPUTER EARN
</BODY>

 HTML coding

   HTML coding result


Remember that you will save your html coding file with html extension.

3  <B> or  <I> or  <U>

 If you want to distinguished some text from other's text. you can performed this task by using these three tags. 1) <b>,  <u>,  <I>
B stand for Bold, U stand for Underline, I stand for Inclined
EXAMPLE
<BODY>
I visit many blogs but <b> LEARN COMPUTER EARN </b> is the best of all. I suggest you to visit regularly this blog<u> LEARN COMPUTER EARN</u>. <I> I hope you will.</I>
</BODY>
  
4    <P>
The <p> tag defines a paragraph.
Browsers automatically add some space (margin) before and after each <p> element. The margins can be modified with CSS (with the margin properties).
EXAMPLE
<P> THIS IS A PARAGRAPH ABOUT LEARN COMPUTER EARN </P>
5    <BR>
The <br> tag inserts a single line break.
The <br> tag is an empty tag which means that it has no end tag.
EXAMPLE
<BR> THIS TAG IS USED FOR SINGLE LINE BREAK
6    <h1> - <h6>

The <h1> to <h6> tags are used to define HTML headings.
<h1> defines the most important heading. <h6> defines the least important heading.
EXAMPLE
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>


7 <p> TAG ATTRIBUTES
It is used for format the paragraph means set your paragraph at center,left or right of page.For this purpose following attributes are valid.
<p align="center"> center text </p>
<p align="left"> center text </p>
<p align="right"> center text </p>
EXAMPLE
<p align="center"> learncomputerearn.blogspot.com </p>
<p align="left"> this is a learning website </p>
<p align="right"> this is a learning website </p>
8   HTML Link
HTML links are defined with the <a> tag.
EXAMPLE
< a href ="http://www.learncomputerearn.blogspot.com"> this is a link</a>
Result of above HTML code will be this is a link
TUTORIAL NO 3

9      HTML Images 



- The <img> Tag and the Src Attribute

In HTML, images are defined with the <img> tag. 
The <img> tag is empty, which means that it contains attributes only, and has no closing tag.
To display an image on a page, you need to use the src attribute. Src stands for "source". The value of the src attribute is the URL of the image you want to display.
<img src="url" alt="some_text"/>
The browser displays the image where the <img> tag occurs in the document. If you put an image tag between two paragraphs, the browser shows the first paragraph, then the image, and then the second paragraph.

 The Alt Attribute

The required alt attribute specifies an alternate text for an image, if the image cannot be displayed.
The value of the alt attribute is an author-defined text:
<img src="IMG_111" alt="WE ARE SORRY" />

IMAGE RESULT
The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).

ALT RESULT

The height and width attributes are used to specify the height and width of an image.
The attribute values are specified in pixels by default:
<img src="IMG_111" alt="WE ARE SORRY" width="304" height="228" />
 It is a good practice to specify both the height and width attributes for an image. If these attributes are set, the space required for the image is reserved when the page is loaded. However, without these attributes, the browser does not know the size of the image. The effect will be that the page layout will change during loading.

HTML Tables

Tables are defined with the <table> tag.
A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). td stands for "table data," and holds the content of a data cell. A <td> tag can contain text, links, images, lists, forms, other tables, etc.

<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
Result of above codes.

row 1, cell 1row 1, cell 2
row 2, cell 1row 2, cell 2

HTML Tables and the Border Attribute
If you do not specify a border attribute, the table will be displayed without borders. Sometimes this can be useful, but most of the time, we want the borders to show.
To display a table with borders, specify the border attribute:
HTML Table Headers
Header information in a table are defined with the <th> tag.
All major browsers display the text in the <th> element as bold and centered.


<table border="1">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>
result of above codes. 

Header 1Header 2
row 1, cell 1row 1, cell 2
row 2, cell 1row 2, cell 2


HTML List

An unordered list

  • List item
  • List item
  • List item

An ordered list:

  1. The first list item
  2. The second list item
  3. The third list item

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.

The list items are marked with bullets (typically small black circles).
<ul>
<li>Tea</li>
<li>Milk</li>
</ul>

result of above codes
  • Tea
  • Milk

An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.

The list items are marked with numbers.
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>

result of above codes
  1. Tea
  2. Milk

HTML Definition Lists

A definition list is a list of items, with a description of each item.
The <dl> tag defines a definition list.
The <dl> tag is used in conjunction with <dt> (defines the item in the list) and <dd> (describes the item in the list):
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>

result of above codes
Coffee
- black hot drink
Milk
- white cold drink
HTML Block Elements

Most HTML elements are defined as block level elements or as inline elements.
Block level elements normally start (and end) with a new line when displayed in a browser.
Examples: <h1>, <p>, <ul>, <table>

HTML Inline Elements

Inline elements are normally displayed without starting a new line.
Examples: <b>, <td>, <a>, <img>

The HTML <div> Element

The HTML <div> element is a block level element that can be used as a container for grouping other HTML elements.
 The <div> element has no special meaning. Except that, because it is a block level element, the browser will display a line break before and after it.
When used together with CSS, the <div> element can be used to set style attributes to large blocks of content.
Another common use of the <div> element, is for document layout. It replaces the "old way" of defining layout using tables. Using tables is not the correct use of the <table> element. The purpose of the <table> element is to display tabular data.

The HTML <span> Element

The HTML <span> element is an inline element that can be used as a container for text.
The <span> element has no special meaning.
When used together with CSS, the <span> element can be used to set style attributes to parts of the text.

HTML Grouping Tags

TagDescription
<div>Defines a div
<span>Defines a span

HTML Layouts - Using <div> Elements

The div element is a block level element used for grouping HTML elements.
The following example uses five div elements to create a multiple column layout, creating the same result as in the previous example:

Example

<!DOCTYPE html>
<html>
<body>

<div id="container" style="width:500px">

<div id="header" style="background-color:#FFA500;">
<h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>

<div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
<b>Menu</b><br />
HTML<br />
CSS<br />
JavaScript</div>

<div id="content" style="background-color:#EEEEEE;height:200px;width:400px;float:left;">
Content goes here</div>

<div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
</div>
</body>
</html>




Comments

Post a Comment

Popular posts from this blog