Tuesday 31 December 2013

Ordered List

Lists

HTML provides us three different types of lists which are given as follows:

  1. Ordered List
  2. Unordered List
  3. Definition List

Ordered List:

<ol> tag is used to start an ordered list.

List Item Element <li></li> is used to insert a an item in the list.

There are three types of ordered list.

  1. Numbered List
  2. Alphabetic List
  3. Roman Number List

Important Attributes of <ol> tag:

type: determines the type of the list whether it would be a numbered list, alphabetic list or roman numbers list.

start: determine the starting number for the list whether an alphabetic list should start from the 'a' or from 'd' or form any other alphabet.

Possible values of both the attributes are given in the following table.

Value of type attribute Value of startattribute
1 Positive integer
a Positive integer
A Positive integer
i Positive integer
I Positive integer

 

Example of Ordered List with Numbers:

Exemplary Code:
<ol>
    <li>I'm the first element of the ordered list</li>
    <li>I'm the second element of the ordered list</li>                  
    <li>I'm the third element of the ordered list</li>
    <li>I'm the fourth element of the ordered list</li>
</ol>
Example Result:
  1. I'm the first element of the ordered list
  2. I'm the second element of the ordered list
  3. I'm the third element of the ordered list
  4. I'm the fourth element of the ordered list

In the above example we are using an ordered list. We have not defined its type and the starting value as by default it's type is '1' and started from '1'. It increases automatically by 1.

Example of Ordered List with Alphabets:

Exemplary Code:
<ol type="a">
    <li>I'm the first element of the ordered list</li>
    <li>I'm the second element of the ordered list</li>                  
    <li>I'm the third element of the ordered list</li>
    <li>I'm the fourth element of the ordered list</li>
</ol>
Example Result:
  1. I'm the first element of the ordered list
  2. I'm the second element of the ordered list
  3. I'm the third element of the ordered list
  4. I'm the fourth element of the ordered list

In the above example we are using an ordered list of type 'a'. We have not defines its starting value as By default it starts from '1'. It also increases automatically by 1.

Exemplary Code:
<ol type="i"start="3">
    <li>I'm the first element of the ordered list</li>
    <li>I'm the second element of the ordered list</li>                  
    <li>I'm the third element of the ordered list</li>
    <li>I'm the fourth element of the ordered list</li>
</ol>
Example Result:
  1. I'm the first element of the ordered list
  2. I'm the second element of the ordered list
  3. I'm the third element of the ordered list
  4. I'm the fourth element of the ordered list

In the above example we are using an ordered list of type 'i' starting from '3'. It also increases automatically by 1.

You can try other remaining types of the ordered list.

Unordered List

Unordered List:

<ul> tag is used to start an unordered list.
List Item Element <li></li> is used to insert a an item in the list.
There are three types of unordered list:
  1. Disc List
  2. Circle List
  3. Square List

Important Attributes of <ul> tag:

type: determines the type of the list whether it would be a circle list, disc list or square list.
Possible values of the type attribute are given in the following table.
Value of type attribute
Disc
Circle
Square

Example of Unordered List of Type Disc:

Exemplary Code:
<ul>
    <li>I'm the first element of the ordered list</li>
    <li>I'm the second element of the ordered list</li>                  
    <li>I'm the third element of the ordered list</li>
    <li>I'm the fourth element of the ordered list</li>
</ul>
Example Result:
  • I'm the first element of the ordered list
  • I'm the second element of the ordered list
  • I'm the third element of the ordered list
  • I'm the fourth element of the ordered list

In the above example we are using an unordered list. We have not defined its type as by default it's type is 'disc'.

Example of Unordered List of Type Circle:

Exemplary Code:
<ul type="circle">
    <li>I'm the first element of the ordered list</li>
    <li>I'm the second element of the ordered list</li>                  
    <li>I'm the third element of the ordered list</li>
    <li>I'm the fourth element of the ordered list</li>
</ul>
Example Result:
  • I'm the first element of the ordered list
  • I'm the second element of the ordered list
  • I'm the third element of the ordered list
  • I'm the fourth element of the ordered list

In the above example we are using an unordered list of type 'circle'.

Example of Unordered List of Type Square:

Exemplary Code:
<ul type="square">
    <li>I'm the first element of the ordered list</li>
    <li>I'm the second element of the ordered list</li>                  
    <li>I'm the third element of the ordered list</li>
    <li>I'm the fourth element of the ordered list</li>
</ul>
Example Result:
  • I'm the first element of the ordered list
  • I'm the second element of the ordered list
  • I'm the third element of the ordered list
  • I'm the fourth element of the ordered list

In the above example we are using an ordered list of type 'i' starting from '3'. It also increases automatically by 1.
You can try other remaining types of the ordered list.

Target Attribute of Anchor Element

Target Attribute:

Target Attribute is used to specify whether the linked webpage/document/file will be:
  • opened in the current tab of the browser.
  • opened in the new tab, next to the current tab, of the browser.
  • opened in the new window (not in new tab).
An example of the target attribute is given as following which covers all the three possible states.
Exemplary Code:
&ltb&gt<a href="url of directed webpage or web site">Hello! I'm testing the Hyper Link tag of HTML. </a></b>
                
Example Result:

Wednesday 30 October 2013

Image Hyper Link

Anchor Element and Its Important Attributes:

An Anchor Element with Image Element is used to create a Image Hyper-link.
Syntax: <a attribute="value"><img src="any source" alt="img_text" /></a>
Important Attributes:
  1. href: takes the URL of the target id as its value.
  2. target: describes whether the linked document should get opened in the same or new tab, parent frame or child frame or in a new window.
  3. name: takes any valid group of alphanumeric characters as its value.

Examples:

Following are some examples which illustrate how to use an Anchor Element to create a:
  1. Image Hyperlink Targeting a Webpage/Document
  2. Image Hyperlink Targeting a Section with in a Same Webpage
  3. Image Hyperlink Targeting a Section in a Different Webpage

Image Hyperlink Targeting a Webpage/Document:

Exemplary Code:
<a href = "https://www.facebook.com/webdevelopmentwithkhuram/"><img src="W3_Logo_3.png" width="150" height="150"/></a>
                
Example Result:

Explanation of the Example:
  1. Anchor Element containing Image Element ,with in it, is used to create an Image Hyperlink.
  2. The URL of the target document is given as a value of the href attribute.
  3. The picture to be displayed is put in between <a> and </a> tags using <img /> Element.

Image Hyperlink Targeting a Section with in a Same Webpage

Exemplary Code:
<a href="back_to_top"></a> 
<nav>
    <a href="#target_3"><img src="W3_Logo_3.png" alt="" height="30" width="30"/></a>
    <a href="#target_4"><img src="W3_Logo_3.png" alt="" height="30" width="30"/></a>
</nav>
<p>
    This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.
</p>
<a name="target_3"></a>
<p><h2> This is target 3</h2></p>
<a href="#back_to_top">Top</a>
<p>
    This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.
</p>
<a name="target_4"></a>
<p><h2> This is target 4</h2></p>
<a href="#back_to_top">Top</a>
Example Result:


This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplar text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.


This is target 1


Top
This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.


This is target 2


Top

Explanation of the Example:
  1. Anchor Element is used to set the "target 1", "target 2" and " back_to_top" targets.
  2. name attribute of the Anchor Element takes the values "back_to_top", "target_1" and "target_2" to set the targets.
  3. href attribute of the Anchor Element takes names("target 1", "target 2" and " back_to_top") of the target preceded by a '#' symbol as a url.
  4. The text to be displayed (such as Home, About Us, Help, Download) is put in between <a> and </a> tags for the links.
  5. No text is displayed in between the <a> and </a> tags where the targets are set and the href attribute is not used.
Note: Hash symbol '#' in href indicates that the target is in internal link and can be in the same or in a different document.

Image Hyperlink Targeting a Section in a Different Webpage:

Exemplary Code:
<a href="back_to_top"></a> 
<nav>
    <a href="#target_3"><img src="http://localhost/Blogger/Hyper_Link.html#target_1" alt="" height="30" width="30"/></a>
    <a href="#target_4"><img src="http://localhost/Blogger/Hyper_Link.html#target_2" alt="" height="30" width="30"/></a>
</nav>
<p>
        This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.
</p>
<a name="target_3"></a>
<p><h2> This is target 3</h2></p>
<a href="#back_to_top">Top</a>
<p>
        This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.
</p>
<a name="target_4"></a>
<p><h2> This is target 4</h2></p>
<a href="#back_to_top">Top</a>
Example Result:

This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.


This is target 3


Top
This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.


This is target 4


Top

Explanation of the Example:
  1. Anchor Element is used to create a Text Hyperlink.
  2. The URL of the target document is given as a value of the href attribute.
  3. The text to be displayed (such as Home, About Us, Help, Download) is put in between <a> and </a> tag.

Font Faces and Font Colors in HTML

Different font styles (faces) are used in the webpages as well as in other documents to show the text in different styles and formats. For this purpose HTML provides us element. Using font element we can format the text in different styles, color and size. Let have look at each of the following!

Font Face:

Font face is the name of the Font which you are using currently in for your webpage or part/section of the webpage. Different famous and mostly used font faces are Arial, Comic Sans, Courier, Georgia, Times New Roman and Verdana.

Example:
Code:
<font face="Arial">I’m <b>Arial</b> style text</font><br />
<font face="Courier">I’m <b>Courier</b> style text</font><br />
<font face="Times New Roman">I’m <b>Times New Roman</b> style text</font><br />
<font face="verdana">I’m <b>Verdana</b> style text</font><br />
Result:
I’m Arial style text
I’m Courier style text
I’m Times New Roman style text
I’m Verdana style text

Font Color:

Color property of the Font element is used to display the text in different colors instead of default black. HTML provides some color names-such as red, green, blue, sky blue, white, etc. - which can be used as value of the color property.

Example:
Code:
<font color="green">I’m <strong>Green</strong> colored text</font><br />
<font color="blue">I’m <strong>Blue</strong> colored text</font><br />
<font color="purple">I’m <strong>Purple</strong> colored text</font><br />
<font color="orange">I’m <strong>Orange</strong> colored text</font><br />
Result:
I’m Green colored text.
I’m Blue colored text.
I’m Purple colored text.
I’m Orange colored text.

Font Size:

Size is also a property of the font element which is used to display text in different size. It ranges from 1 to 7 units.

Example:
Code:
<font size="1">I’m size <strong>1</strong> text</font><br />
<font size="2">I’m size <strong>2</strong> text</font><br />
<font size="3">I’m size <strong>3</strong> text;</font><br />
<font size="4">I’m size <strong>4</strong> text</font><br />
<font size="5">I’m size <strong>5</strong> text</font><br />
<font size="6">I’m size <strong>6</strong> text</font><br />
<font size="7">I’m size <strong>7</strong> text</font><br />
Result:
I’m size 1.
I’m size 2.
I’m size 3.
I’m size 4.
I’m size 5.
I’m size 6.
I’m size 7.

Basic Text Formatting in HTML

Basic Text Formatting in HTML

While formatting our documents we often need to format some pieces of text as bold, italic, underline, superscript, subscript and/or strikethrough to show the importance of the text. HTML provides us different tags perform such type of formatting. Let’s have look at each one!

Bold or Strong:

In HTML to format some piece of text as bold we can use and/or elements.

Example:
Code:
<b>I’m bold text</b>
<b>I’m strong text</b>

                
Result:
I’m bold text
I’m strong text

Difference between Bold & Strong:

There are some browsers which are used by the special peoples (disabled) who can see nothing on the screen. Rending of webpages on such browsers is done by reading text loudly. The text wrapped in strong element is read stressfully which indicates that the stressed text is important, while the text wrapped in b element is read normally without producing any stress to inform the listener that there is nothing special here

Italic:

In HTML to format some piece of text as italic we can use elements.

Example:
Code:
<i>I’m italic text</i>
                
Result:
I’m italic text

Underline

In HTML to format some piece of text as underlined we can use elements.

Example:
Code:
<u>I’m underlined text</u>
                
Result:
I’m underlined text

Super/Sub Scripts

In HTML to format some piece of text as underlined we can use elements.

Example:
Code:
He's the 11<sup>th</sup> player of the team.
a<sub>1n</sub>, a<sub>2n</sub>, a<sub>3n</sub>......,a<sub>n</sub>
Result:
He's the 11th player of the team.
a1n, a2n, a3n......,an

Strike Through:

In HTML to format some piece of text as strike through we can use elements.

Example:
Code:
<Strike>I’m strike through text</strike>
Result:
I’m strike through text

Linefeed

Goto Line Break Section in the …………………… Post

Paragraph

In HTML to divide a long topic, under discussion, into different paragraph we use <p> element.

Example:
Code:
<p>I’m a paragraph.</p>
<p>I’m another paragraph.</p>
Result:

I’m a paragraph.

I’m another paragraph.


Note: The ending tag of the paragraph </p> is optional, you can get the accurate result without using it. But if you are using XHTML thne it would be necessary to include the ending tag of Paragraph Element.

The Paragraph Element automatically includes a Line Break Element, so you don't need to include line break to feed a new line after a paragraph.

Monday 30 September 2013

HTML Entities\Special Characters

What are Special Characters?

The characters, other than the alphabets, numbers and common symbols, like © (copy right), ™ (trade mark), € (euro sign), ® (registered), ≥ (greater than), Ω (omega), α (alpha), and β (beta) are known as special characters.
We often need to put some of these special characters in our ordinary documents and especially in mathematics documents.
The bad news here is that you cannot insert these special characters in your document directly like alphabets and numbers. You need to put code to insert these characters in our document. These characters can be very useful for your webpages. If, for example, your website contains mathematical data or you want to show copy right or trademark symbols on your website then you need to learn how to insert these characters. A brief description on this is given below:

Special Characters in HTML

Even in ordinary documents we cannot put special characters directly using keyboard instead we’ve to do something else to enter such special character like to insert a symbol we insert it from the Symbols in MS Word 2010 or in Open Office. Same thing apply here for HTML documents in order to insert special character in your webpages. Unlike word processors you need to provide some special codes to enter these characters. The detailed table is given here below in which a code is given against each symbol.
Symbol HTML Entity Name
& &amp; Ampersand
¢ &cent; Cent
© &copy; Copyright
÷ &divide; Divide
< &lt; Less than
> &gt; Greater than
µ &micro; Micron
· &middot Middle dot
&para; Pilcrow (paragraph sign)
± &plusmn; Plus/Minus
&euro; Euro
£ &pound; British Pound Sterling
® &reg; Registered
§ &sect; Section
&trade; Trade Mark
¥ &yen; Japnese Yen

White Spaces in HTML

What are White Spaces?

In a normal document, like a *.doc document (MS word document) or any other, you need to insert some invisible characters like space, tab (a combination of 8 spaces), new line, section break and page break etc to improve readability of the reader and the look of the document. These invisible characters are known as white spaces.

White Spaces in HTML

Like any other document when we create any webpage (HTML document) we need to insert some white spaces to improve the readability of the users and the look of the document as you are observing in this webpage. In advanced word processors you can insert white spaces in your document quite easily but in case of an HTML document, except the single space white space, you can’t include other white spaces directly in your webpage. For example, you can’t include a:

  • Newline directly in your webpage by just pressing the Enter Key.
  • Tab directly in your webpage by just pressing the tab key.

There are different and special words, provided by the HTML, used to insert such white spaces, which cannot be inserted directly using standard keyboards, in a webpage. Here is some explanation of how to insert different white spaces in a webpage:

Inserting more than one spaces in an HTML Document

A single space can easily be inserted in an HTML document as in any word processor. But, what you’ll do if you want to add more than one single space consecutively in your HTML document as if you’ll insert many spaces in your HTML document, while writing HTML code, only one space will be rendered by the web browser and other spaces will be ignored and not shown. For this purpose you need to do something special and HTML provides us a way to insert many single spaces in your webpage. You need to include &nbps at the point where you want to enter spaces in your webpage.

Exemplary Code:
<b>I've &nbsp &nbsp included &nbsp &nbsp  two &nbsp &nbsp  spaces &nbsp &nbsp  after &nbsp &nbsp each &nbsp &nbsp word! </b> </br<
Example Result:
I've     included     two     spaces     after     each     word!

Insert Tab in an HTML Document

Tabs are used to enter a gap of eight spaces between a word and its explanation. It is useful to align your document text. Unfortunately HTML doesn’t provide us the facility to insert a tab in your webpage. If you want to enter a tab in a webpage you can use &nbsp 8 times.

Exemplary Code:
<b>Name: &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp M.Khuram</b></br>
<b>E-Mail: &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp m.khuramj@yahoo.com</b> </br>
Example Result:
Name:                 M.Khuram
E-Mail:                 m.khuramj@yahoo.com

But it's better to use tables for such type of alignment of text.

Insert a New Line in an HTML Document

When you are working with text you need to end and start lines and paragraphs. For this purpose we need to enter a new line in a document. HTML provides us a tag to insert a newline in your webpage, you need to include </br>, <br></br> or <br /> tag at the point where you want to include a new line on your webpage.

Exemplary Code:
<b>This is an exemplary sentence and at the end of this sentence we’ll start our new line!</b></br></br>
<b>This is also an exemplary sentence which is written after a <em>line break</em> included in this<em>webpage.</em>
Example Result:
This is an exemplary sentence and at the end of this sentence we’ll start our new line!

This is also an exemplary sentence which is written after a line break included in this webpage.

Thursday 26 September 2013

Structure of a Webpage

No Need to Purchase Any Extra Software to Create a Webpage!

To produce or create anything in this world we first need to understand the thing itself and its structure. Understanding the structure of an object we can not only create it but also improve it. A webpage is a hypertext document and like every other thing a webpage also has a structure and consists of different parts such head and body. Each of these parts of the webpage is explained in the following paragraphs:

Document Type

A webpage can be written in any of the available versions of HTML. That's why, first of all the type (version) of the webpage is checked whenever a webpage is rendered in a web browser. Then the webpage is displayed according to the type of the HTML. To specify the type of the webpage we use the <!DOCTYPE> tag. This is the very first tag in a webpage. It tells a browser what version of HTML should be used to render the webpage. We can use any version of the HTML or XHTML (it depends upon available technology in a particular region). Different versions and there <!DOCTYPE> is given in the following table:
Version Doctype
HTML 5 <!DOCTYPE html>
HTML 4.01 <!DOCTYPE HTML PUBLIC "-//W3C//DRD HTML 4.01//EN" "http:// www.w3.org/TR/html4/strict/dtd"&gt
XHTML 1.0 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt
XHTML 1.1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Frameset//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt

Page Declaration <html></html>

If you wanna write, sketch or draw something you need to have a page whether it would be a hard page (a page having physical existence like a printed page) or soft page (a page white blank working area shown in word processors as a page). Same thing implements here in web development. You need to declare a (logical) page where you'll display your text and objects on it. To declare a (logical) page we use <html></html> tags. This is the second starting tag of our webpage and ends in the end. All other tags are put in between <html></html> tags. This page can further be divided in different sections and blocks i.e. head and body.

Head <head></head>

Now we have declared a page for displaying our data on a web browser. The next step is to divide this page in different portions to put our data for the user and for the server and Search Engine. All the tags and data (like version of HTML, title of the webpage, language, author etc) in head element is used either by the server, search engine or web browser. Nothing is pur here for user in this element.

Title <title></title>

When we are developing a website, it is possible that the site may consist of tens, hundreds or even thousands of webpages. It is necessary to entitle each and every webpage with a suitable title to distinguish it from the others (This is helpful for the Search Engines. You'll learn about it later in this tutorial). That's why, HTML provides us a tag to entitle a webpage. This title is shown on the title bar (in old web browsers) or on the tab (in advanced web browsers) of the web browser. This tag is put in between the <title></title> tags.

Body <body></body>

After Head the Body is the second portion of our webpage. All the elements mentioned above are very important for the servers, search engines and web browsers but are not displayed in a browser window for the users except the title tag. But data in between <body></body> tags is the actual data which is displayed in browser window for the users (if not hidden deliberately) i.e headings, text, tables, lists, images, etc.

Example of a Webpage:

Follow the following steps to check the example for better understanding.
  1. Copy the following code.
  2. Open Notepad.
  3. Paste the code in Notepad. (Open the Edit menu --> Paste)
  4. Save the file with .html extension. (Open File menu --> Save As --> Name the file as "Example.html" including double quotes)
  5. Open the file in any web browser and Match the result in the given picture.
Exemplary Code:
<html>
  <head>
     <title> Exemplary Title</title>
  </head>

  <body>
    <b>This is the body of the webpage!</b></br>
    <b>Every thing, in this portion of the webpage, will be displayed in the browsers window</b>
  </body>
</html> 
                
Example Result:
Exampalry Title This is the body of the webpage! Every thing, in this portion of the webpage, will be displayed in the browsers window

Saturday 31 August 2013

What Software Is Required to Create a Webpage

No Need to Purchase Any Extra Software to Create a Webpage!

The good news is that if you want to create your own hand-written webpages you need not to purchase any extra software to start your journey of the wonderful world of web development. The creators of HTML had worked hard for us in such a brilliant way that we can even use a simplest word processor i.e. note pad (for windows) to develop a webpage without facing any serious hurdle.

Software You Can Use to Create a Webpage

Two types of software can be used to develop a webpage which are explained here below:

Specially Designed Software:

You can create a webpage using specially designed software for web development i.e. Dream Viewer or any other. These type of software provide tow interfaces; HTML Interface, for HTML code writing or/and editing, and a Design Interface to provide the facility of creating a webpage without writing any code.

In the Design interface you need not to enter HTML tags and lengthy pieces of code to perform various tasks in your webpage such as formatting text and paragraphs, inserting tables, lists, form’s elements and other elements. All these tasks are done just by clicking on icons, selecting commands from menus and setting and providing some values like you do in advance word processors while working on your official or personal documents. These software also provide the facility of managing folders containing your webpages, images and sub-folders quite easily. Another facility provided by these software is auto word completion/suggestion for the words which are reserved by the language developers for the HTML language or reserved by the web developer who is creating webpages using HTML. Auto word completion/suggestion means when you type a few letters of these reserve words you are shown a list of words next to the ending letter of the word and you can select the appropriate word from that list instead of typing the complete word.
The HTML Interface, of such software, provides you an access to HTML code which is generated automatically at the back-end of the software while working on the fronted (in Design Interface). This interface is helpful when you want to gain more control for designing and securing your website or solve a problem which is not possible to solve by working with Design Interface. In my opinion, this is very useful tool. One important thing about such software which should be remembered is: "More ease causes less control/security i.e. in Design Interface, while less ease causes more control/security i.e. in HTML Interface".

Simple Word Processor

Using a simple word processor, like note pad, you have to write and manage the HTML code of your webpage yourself as the word processor will not do this job for you unlike in Dreamweaver's Design Interface (if you did not understand at this moment, keep reading, you’ll understand at the end of this heading). By writing HTML code and managing the folders containing your webpages and images yourself, you gain less ease but much control/security. Some word processors like Notepad ++ (a freeware software) are user friendly and provides you some facilities such as to show the code in different colors and inserting the line numbers on the start of each line to help the web developers and someone else who want to read and understand that code.

Beginners Should not Use Specially Designed Software for Web Development

If you want to become a top quality webmaster, I would recommend you not to use software like Dream viewer at beginning level. The reason is that when you use such a software you don’t write the code yourself, as a result you don’t get familiar of HTML syntaxthe rules of any computer language which describes the way of writing statements to tell the computer what to do -- and coding style, you are not habitual of time consuming process of understanding and writing code. This could put you in trouble while you are working on a project and unfortunately you’ve faced a problem which is not getting solved with the Design Interface of your software and the only way to solve the problem is to use HTML Interface to overcome this problem. Working with the Design Interface of these software you could not solve it as you are not familiar of the HTML syntax, coding style and understanding code. But feel free to use Design Interface of such software when you’ve full control over HTML syntax and coding.

Use Simple Word Processor for Web Development

It is good for the beginners to use word processors or HTML Interface of such software to write code of a webpage. In this way you have to write the code yourself and you’ll get aware of what and how you are doing on your webpage. You'll learn HTML syntax, coding style, and understanding of code which will be useful in future. Notepad can also be used but you can download Notepad++ and install it on your computer.
After installation of Notepad++ you are ready to create your own webpage. Proceed to the next topics to understand the structure of a webpage and then start your coding properly to create a webpage!

Text Hyper Link

What is Hyperlink & What Hyper-Link Does!

A piece of text or an image that directs a user to another document i.e. webpage, next/previous topics or sections on the same webpage or to an Email Address just by clicking/taping on it is called a Hyperlink.

Difference in the Look of Hypertext and Normal Text:

By default, simple and non-hyper-linked text is in black color and the picture looks same as it looks in any image viewer without any change and nothing happens by clicking such text or image.
While on the other hand, a Hyper-linked text looks different from the non-hyper-linked text. By default Hyper-linked text is in blue color and is underlined and the image looks same as it looks in any image viewer without any change.

Whenever a user drags mouse pointer over (in technical term hover) a Hyper-linked text or image, the mouse pointer gets changed into a hand shape from a normal arrow shape (on windows). When a user clicks a Hyper-linked text its color also gets changed, normally from blue to purple, to indicate that the user has already visited this particular link.

Anchor Element and Its Important Attributes:

An Anchor Element is used to create a Text Hyper-Link or an Image Hyperlink
Syntax: <a attribute="value">Text to be displayed</a>
Important Attributes:
  1. href: takes the URL of the target id as its value.
  2. target: describes whether the linked document should get opened in the same or new tab, parent frame or child frame or in a new window.
  3. name: takes any valid group of alphanumeric characters as its value.

Examples:

Following are some examples which illustrate how to use an Anchor Element to create a:
  1. Text Hyperlink Targeting a Webpage/Document
  2. Text Hyperlink Targeting a Section with in a same Webpage
  3. Text Hyperlink Targeting a Section in a Different Webpage

Text Hyperlink Targeting a Webpage/Document

Exemplary Code:
<a href="http://webdevelopingwithkhuram.blogspot.com/p/html-tutorial.html">Go To WebdevelopmentwithKhuram.blogpost.com</a>
                
Example Result:

Explanation of the Example:

  1. Anchor Element is used here to create a Text Hyperlink.
  2. The url of the target document is given as a value of the href attribute.
  3. The text to be displayed (such as Home, About Us, Help, Download) is put in between <a> and </a> tag.

Text Hyperlink Targeting a Section with in a same Webpage

Exemplary Code:
<a href="back_to_top"></a> 
<nav>
    <a href="#target_1">Go To Target_1</a>
    <a href="#target_2">Go To Target_2</a>
</nav>
<p>
    This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.
</p>
<a name="target_1"></a>
<p><h2> This is target 1</h2></p>
<a href="#back_to_top">Top</a>
<p>
    This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.
</p>
<a name="target_2"></a>
<p><h2> This is target 2</h2></p>
<a href="#back_to_top">Top</a>
Example Result:




This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.

This is target 1


Top
This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.

This is target 2


Top

Explanation of the Example:
  1. Anchor Element is used to set the "target 1", "target 2" and " back_to_top" targets.
  2. name attribute of the Anchor Element takes the values "back_to_top", "target_1" and "target_2" to set the targets.
  3. href attribute of the Anchor Element takes names("target 1", "target 2" and " back_to_top") of the target preceded by a '#' symbol as a url.
  4. The text to be displayed (such as Home, About Us, Help, Download) is put in between <a> and </a> tags for the links.
  5. No text is displayed in between the <a> and </a> tags where the targets are set and the href attribute is not used.
Note: Hash symbol '#' in href indicates that the target is in internal link and can be in the same or in a different document.







Text Hyperlink Targeting a Section in a Different Webpage

Exemplary Code:
<a href="back_to_top_1"></a> 
<nav>
    <a href="#target_1">Go To Target_1</a>
    <a href="#target_2">Go To Target_2</a>
</nav>
<p>
        This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.

</p>
<a name="target_1"></a>
<p><h2> This is target 1</h2></p>
<a href="#back_to_top">Top</a>
<p>
            This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.

</p>
<a name="target_2"></a>
<p><h2> This is target 2</h2></p>
<a href="#back_to_top">Top</a>
Example Result:




This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.


This is target 2


Top
This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph. This is exemplary text of the exemplary paragraph.


This is target 2


Top


Explanation of the Example:
  1. Anchor Element is used to set the "target 1", "target 2" and " back_to_top" targets.
  2. name attribute of the Anchor Element takes the values "back_to_top", "target_1" and "target_2" to set the targets.
  3. href attribute of the Anchor Element takes the url of the other webpage and the names("target 1" and "target 2") of the target preceded by a '#' symbol as a url (i.e url + target section).
  4. The text to be displayed (such as Home, About Us, Help, Download) is put in between <a> and </a> tags for the links.
  5. No text is displayed in between the <a> and </a> tags where the targets are set on the targeted webpage and the href attribute is not used.
Note: Hash symbol '#' in href indicates that the target is in internal link and can be in the same or in a different document.

Saturday 24 August 2013

Web Development, A Step By Step Guidance

Is It Difficult to Learn Web Development?

Many people think that creating their own website is quite difficult but after reading this tutorial you'll witness that actually how easy it is to create a website. So, let’s start to create your own website following this blog. In this blog you’ll come to know that how you can learn web development in a quick and easy way by following a step by step guidance -- instead of choosing topics randomly. Always follow the right steps of learning at right time whatever you want to learn in life. It proved to be more effective when you start to learn things step by step and in a regular way. Things get easy to learn and you learn them very fast due to consistency in your learning behavior. Let’s start.

How to Start Learning Web Development

First of all you must learn some basic terms related to web development & internet such as website, webpage, web server, web client, IP address, HTTP, domain name, WWW, web browser, and etc. Then you should gain introductory knowledge of different languages, which are sued to develop a website, such as HTML, X-HTML, JavaScript, Visual Script, PHP, ASP.NET, SQL, Rail, and many more. After gaining some basic knowledge of web development and its languages, it’s time to move forward and coding to develop your website. For coding you need to learn some languages which I’ve mentioned in the previous paragraph.

HTML

Now you will want to create your own hand generated web pages to develop a website. You may want to include some images or embed videos as well as a web form, paragraphs, lists and tables in your web pages. For doing all of this you must learn HTML before learning any other language during your web development learning process. But before learning HTML I would recommend you to know that actually what HTML is and then you should start to learn it. Click this link to know What is HTML. But if you’ve already learnt HTML then you should proceed to the next paragraph to know that what you should do next after learning HTML.

CSS

As now you can develop your own web page quite easily and you’ve developed some one. But at this stage you can’t make your website quite attractive and good looking. You want to make its look very attractive but with HTML you can’t do that at all. For providing attraction and good look to your website you need to learn CSS instead of learning any other language at this time. But before learning CSS, I, once again, would recommend you to know that what CSS is and then you should start to learn it. Click this link to know What is CSS. But if you’ve already learnt CSS as well, then you should proceed to the next paragraph to know that what you should do next after learning CSS. If you are missing any of these two languages then you should learn the missing one first to move forward.

JavaScript

You are doing your job very well. Your website would getting look good enough with an eye catching view but it’s still unable to respond the user/visitor i.e. you can’t make calculation, take decision, checking the validation of data and processing that data. For all of this you need to learn JavaScript before moving towards any other language. But I would recommend you to know that what JavaScript is before start it learning and then you should start to learn it. Click this link to know What is JavaScript. But if you’ve already learnt HTML, CSS and JavaScript then you should proceed to the next paragraph to know that what you should do next after learning CSS. If you are missing any of these three languages then you should learn the missing one first to move forward.

SQL

Now you are happy as well as a bit confused. You would be keen to make your web pages dynamic, run some sever side script and work with database. Now it’s time to learn SQL instead of learning any other language and even PHP (as, when you’ll start learning PHP, you’ll learn to interact with database, and for database you need SQL. If you’ll not learn SQL on this stage, you could not interact with database). But before learning SQL I would recommend you to know that what SQL is and then you should start to learn it. Click this link to know What is SQL. But if you’ve already learnt HTML, CSS, JavaScript and SQL then you should proceed to the next paragraph to know that what you should do next after learning SQL and if you are missing any of these four languages then you should learn the missing one first to move forward.

PHP

As you’ve learnt SQL you make dynamic web pages, work with some database and running server side script by learning PHP which is here waiting for you! Why should you wait anymore!!!! Before starting PHP learning, I, again, would recommend you to know first that what is PHP and then you should start to learn it. Click this link to know What is PHP. But if you are missing any of these languages; HTML, CSS, JavaScript and SQL, then you should learn the missing one first to move forward.

HTML Elements and Tags

How Browsers Renders an HTML Document?

All of you know that an HTML Document is simply a text file rendered by the web browsers. But the question is that how does the browser knows that a particular piece of text should be rendered as a heading and other as a paragraph or a table. The page you are currently browsing also contains heading, paragraphs etc .
Here is the answer: HTML uses Elements to tell the browsers that how the HTML Document should be rendered. How the particular piece of text should be rendered as a heading and other should be rendered as a paragraph, this data should be rendered as a table and that should be rendered as a list etc.

HTML Element:

Most of the HTML Elements are consists of a pair of a Starting Tag and Ending Tag. Every thing from starting tag to ending tag is an HTML Element. We have two type of HTML Elements which are given as follows:

Not-Empty HTML Elements:

An HTML Element which needs to have both the starting and ending pair of tags otherwise browser might be unable to render that Element correctly such as <html></html> and <body></body> etc.

Empty HTML Elements:

An HTML Elements consists of only Starting Tag and don't need to have an Ending Tag such as Paragraph Element <p> and Image Element<img> .

HTML Tags:

An HTML Tag starts/opens with a left angle bracket (<) and ends/closes with a right angle bracket. There are two types of HTML Tags which are given as follows:

Starting Tag:

A Starting Tag consists of the name of the element and some attributes having values. Empty tags such as <br /> and <hr /> don't contains any attribute.

Ending Tag:

An Ending Tag consists of the name of the element preceded by a forward slash. Empty tags don't have the Ending Tag such as <br /> and <hr />. Instead the Element name is followed by a forward slash in in the Starting Tag.

Example of Bold Element:

Here is an example of an HTML Bold Text Element:
Exemplary Code:
<b>Hello! I'm part of the Bold Element of HTML!</b>
                
Example Result:
Hello! I'm part of the Bold Element of HTML!

In the above example <b> is the Starting Tag and </b> is the Ending Tag of the HTML Bold Text Element. “Hello! I'm testing the Bold Text Element of HTML!” is the phrase which, now, is the part of the HTML Bold Text Element.

Example of Nested Elements:

Here is an example of the nested HTML Elements which is a modification of the  previous example. Point to be noted here is that when you want to nest many HTML Elements you should take care of the order of the Elements. The Element started first will be closed in the end. Look at the following example, the starting tag of the Paragraph Element <p> is the first tag but it's closing tag </p> is the last one.
Exemplary Code:
<p><b><i> Hello! I'm testing the bold & Italic Text Elements of HTML! </i></b></p>
Example Result:
Hello! I'm testing the bold & Italic Text Elements of HTML!

What Is HTML

Background of HTML

Earlier when internet was very new and with a slow data transfer speed it was not possible to browse webpages like we do now a days. The data was transferred over internet in the form of separate files like *.txt, *.doc or any other file instead of a hypertext file (webpage). User had to download the complete file which s/he wanted to. But still it wasn’t sure that user could access files’ data. As after downloading the file, to access its data, user needed the appropriate application to run/execute that file. If the user didn’t have the appropriate application, to run/execute the file, s/he couldn’t access the data of the file.
Also, it was a very much time consuming process to download the file as speed of the internet was very slow and files were very heavy sized due to having formatted data. In this scenario low internet speed was very annoying for the users to download heavy sized files.
These were the real problems as everyone didn’t have the appropriate application or faster internet speed to download or even have a look at (browse) a file on internet. Then it was realized that software (web browser) should be designed which could display a simple hypertext markup files (without any formatting) into well-formatted and well-organized document (webpages). For this purpose HTML and web browsers were developed.
HTML is not a case sensitive language- a language which doesn’t care whether the statements are written in upper or lower case- and HTML tags can be written in either lower or upper case letters and you'll not receive any error. Feel free to write HTML tags in whatever case you want to but it is recommended to write in lower case instead of upper case letters.

Why HTML Is Called Hypertext Markup Language

You’ll be thinking as a hypertext file contains simple text without any formatting then how the webpage looked formatted when we download and see them on a web browser. You’ve raised a valid and a good question. HTML is a called a markup language which means it uses some marks (symbolized letters i.e. some text ). These marks play a vital role in the formatting of a webpages and help the web browser to recognize the specific formatting to be applied on the text or part of text, makes tables and inserts lists and images in a webpage. You’ll further read about tags in the next blog What Are Tags (Marks) in HTML.

Why It Is Called Hypertext Markup Language

Now the actual and core problem was solved. Then further it was realized that these webpages should be interlinked to each other so that users should be provided an easy access to other related webpages of the website being visited. To fulfill these requirements Hyper Link was introduced. Hyper Link is a link assigned to simple text or to an image which directs a user to another webpage or website by clicking on it. You can identify and distinguish a Hyper Link from the simple ordinary text or image by observing the change in the shape of the mouse pointer, from an arrow to hand, and after clicking on it you get another webpage or website on the same or in new window. Due to these marks (a browser reads to format a webpage) and Hyper Links HTML is called Hyper Text Markup Language.

Versions of HTML

HTML has many versions. Its versions start from HTML 2.0 and goes to HTML 4.01. It’s new and upcoming version is HTML 5 which will be released in 2014.

Important Terms:

  1. Compiler is a program that converts High Level code into Binary code.
  2. Web Browser is a program that reads a simple text (HTML) file-webpage-, which contains marks, and displays it as a well-formatted document with the help of some marks in the text file mixed with the original text/data.
  3. Website is a collection of related webpages.
  4. Webpage is a document containing every type of data from simple text to videos.
  5. HTML tags are paired set of symbol to indicate the start point and end point of specific formatting i.e. bold, italic.
  6. Hyper Link is simply a text (or can be an image) and normally is in blue colored and underlined which direct the user to a specific webpage or website.

Friday 23 August 2013

Web Development, Some Basic Terms

If you want to learn web development and want to create your own website then you are on a right place to start. But I would recommend you to you read my blog Web Development, A Step By Step Guidance, then read this one for better understanding and proceed to this blog. If you are not interested, you can skip them and continue to read this post.

Web Development

The process of designing, developing, publishing and maintaining the websites is known as web development. It is the method of publishing data across the world via World Wide Web-i.e. text, audio, videos, and images-using internet.


Webpage

A web page is document written in HTML which can contains any type of data such as text, images, videos etc.

Website

A website is collection of related webpages which are linked using hyperlinks. A web site may contain fewer or even hundreds of webpages stored on web servers.

Web Browser

A web browser is software which is used to display the hyper text files in the form of a well formatted, well designed webpage. Web browsers reads marks in the hyper text file and with help of these marks decides that where the text should be displayed as bold, italic, colorful, large size, etc. It is clear, to know the duty of web browser, that web developer thinks and instructs the web browser about the look of a web page and web browser obeys the instructions and displays webpage as instructed by the web developer.

Internet

Internet is a network of billions of computers connected to each other from all over the world. Computers are connected using different types of communication medium such as cables, radio waves, satellite and etc. Computers also need a transfer protocol for sending and receiving data.

World Wide Web (WWW)

World Wide Web is the combination of all the resources on internet such as web pages, web servers and clients on internet. It is used to share and display data worldwide using a network protocol named HTTP.


IP Address

39.55.97.170 -- this is an IP address. Whenever a computer is connected to internet it is given a unique address which is called an IP address. This address helps a computer to access other computers and website. Web servers have a constant IP address but the IP address of client computer is changed every time when it gets connected to the internet.

Domain Name

It was difficult for the users to remember the complete IP address of each website. To solve this problem the IP addresses of web servers are, now, represented in easy to remember English like words such as webdevelopmentwithkhuram.blogpost, Google, yahoo and etc. otherwise you’ll have to remember lengthy and hard to remember IP Addresses to get access to a website.

URL:

URL stands for Uniform Resource Locator and is known as web address. It consists of two main parts i.e. network protocol and file resource. http://webdevelopmentwithkhuram.blogpost.com is the example of a URL of this page.
Network Protocol is a rule of sending and receiving data, HTTP in the above example. File Resource is the address of the resource you are looking for, http://webdevelopingwithkhuram.blogspot.com in the above example.

Web Client:

The computer you are using to connect to internet to read this blog is considered as a client computer. Client sends request/s to the web server and, in response; server sends the requested webpage/s to client. Client, then, renders the sent webpage and displays it via a web browser i.e. Chrome, Firefox or any other.


Web Server

A web server is a powerful computer which is used to store the websites. A server receives the web client's request and sends the requested webpages, of the typical website, to the user’s computer (web client).

Client Side Scripting

Some part of the webpage code is run on the web client and other is run on the web server. The part of code run on the web client is known as Client Side Scripting such as filling an online web form where you might be warned, if something gets wrong, or suggested the alternative by prompting you to re-enter your data.

Server Side Scripting

The part of code run on the web client is known as Client Side Scripting such as filling an online web form where you might be warned, if something gets wrong, or suggested the alternative by prompting you to re-enter your data.