Tuesday, September 4, 2012

Lecture 4: Adding Image, Audio and video

Dear friends Nabin here again its a long time i was absent because of  little busyness now here is my next lesson for you.



Lecture 4: Adding Image, Audio and video

In order to show rich media on your pages, you will need to learn a new element, the <object> element. You need to know that the <object> element can tell the browser several things, including:
The name of the file and where to find it
The format of the file
The type of plug - in used to play the file

Inside the <object> element, you can use the <param> element to pass extra information to the player. The <param> element is not the only markup you are likely to see inside the <object> element. But any other markup you see inside the <object> element is only likely to be shown if the browser cannot render the object (and the most common reason is that the required player is not installed). We will learn these things in this session.

4.1 Adding Image


Images are added to a site using the <img> element, which has to carry at least two attributes: the src attribute, indicating the source of the image, and an alt attribute, which provides a description of the image.  For example, the following line would add the image called logo.gif into the page.

<img src=”image/banana.jpg” alt=”banana” />

4.1.1 Setting Height and Width

The height and width attributes specify the height and width of the image, and the values for these attributes are almost always shown in pixels.

<img src=”image/banana.jpg” alt=”banana” height=”120” width=”180” />

4.1.2 Setting alignment


The align attribute was created to align an image within the page (or if the image is inside an element that is smaller than the full page, it aligns the image within that element). The align attribute can take one of the values from top, middle, left, right and bottom.
<img src=”image/apple.jpg” alt=”apple” align=”left” />


4.1.3 Setting boarder

A border is a line that can appear around an image or other element. By default, images do not have borders, so you would only have used this attribute if you wanted to create a border round an image.

<img src=”image/apple.jpg” alt=”apple” align=”left” border=”2” />

4.1.4 Setting vertical and horizontal space

The hspace and vspace attributes can be used to control the amount of white space around an image. The value is the amount in pixels of white space that should be left around the edge of the image.

<img src=”images/apple.jpeg” alt=”class” align=”left” border=”2” hspace=”10” vspace=”12”/>


4.1.5 Using images as links
It i s easy to turn an image into a link; rather than putting text between the opening <a> tag and the closing </a> tag, you simply place an image inside these tags. Images are often used to create graphical buttons or links to other pages.

<a href=”page.html” title=”Click here to return to the home page”>
< img src=”image/apple.jpg” width=”100” height=”70” alt=”apple” />
</a>

4.1.6 Image map
Image maps allow you to add multiple links to the same image, with each link pointing to a different page. There are actually two types of image maps, both of which do the same job. The difference is how they work out which hotspot you clicked on.

Client - side image maps: The web browser works out which part of the image the user has clicked on and takes the user to the appropriate page.

Server - side image maps: The browser sends the server the coordinates, saying which part of the image the user clicked on, and these are processed by a script file on the server that determines which page the user should be sent to.

4.1.6.1 Client side image map
Client - side image maps use XHTML code to tell the browser how the image will be divided up; then the browser can tell what part of the image someone clicks on and can send the user to the appropriate link.


There are two methods to create a client - side image map:
Using the <map> and <area> elements inside an <img> element
Using the <map> element inside the <object> element

Client - Side Image Maps using <map> and <area>
An attribute called usemap is then added to the <img> element to indicate that this image needs to use the information held in the corresponding <map> element to turn the image into an image map. The <map> element then contains the information used to tell the browser how to split up the image so that it can send the user to the correct page.

The <map> element usually follows directly after the <img> element. It needs to carry only the name attribute to identify itself. The <map> element then contains two or more <area> elements, and it is these <area> elements that actually define the clickable hotspots. The <area> element does this by specifying the shape and the coordinates that define the boundaries of each clickable hotspot.

<body>
    <p>
      <img src="image/map.gif" alt="Map" width="500" height="300" border="0" usemap="#cafe" />
        <map name="cafe">
          <area shape="circle" coords="154,150,59" href="Cafe.html" target="_self" alt="Cafe">
          <area shape="poly" coords="272,79,351,79,351,15,486,15,486,218,272,218,292,166,292,136,270,76" href="courtyard.html" target="_self" alt="Courtyard">
          <area shape="rect" coords="325,224,488,286" href="Kitchens.html" target="_self" alt="Kitchens">
        </map>
    </p>
    </body>

The value of the shape attribute actually affects how the browser will use the coordinates specified in the coords attribute, and is therefore required. If you do not specify a shape attribute, the default value is a rectangle.

The coords attribute specifies the area that is the clickable hotspot. The number of coordinates you specify depends on the shape you are creating (and have specified in the shape attribute).

A rectangle contains four coordinates. The first two coordinates represent the top left of the rectangle, and the second two the bottom right.

A circle contains three coordinates; the first two are the center of the circle, while the third is the radius in pixels.

A polygon contains two coordinates for each point of the polygon. So a triangle would contain six coordinates, a pentagon would contain ten, and so on. You do not need to specify the first coordinates again at the end because the shape is automatically closed.

Client - Side Image Maps using the <object> Element
The technique is very similar to the one you just met, but this time it is the <object> element that carries the usemap attribute. Inside the <object> element, you use the familiar < map > element with the name attribute. Then inside the <map> element are standard <a> elements rather than <area> elements.

<object data="image/map.gif" type="image/gif" alt="Map" width="500"
height="300" border="0" usemap="#cafe" />
<map name="cafe">
<a shape="circle" coords="154,150,59" href="cafe.html" target="_self" > Cafe </a>
<a shape="poly" coords="272,79,351,79,351,15,486,15,486,218,272,218,292,166,292,136,270,76"
href="courtyard.html" target="_self" > Courtyard </a>
<a shape="rect" coords="325,224,488,286" href="kitchens.html" target="_self">Kitchens </a>
</map >
</object>


4.2 Adding Audio

Audio can be added in many different ways in a web page. Here we explain some of them.

4.2.1 Using a Hyperlink
If a web page includes a hyperlink to a media file, most browsers will use a "helper application" to play the file. The following code fragment displays a link to an MP3 file. If a user clicks on the link, the browser will launch a helper application to play the file.
 <a href="audio/mela.mp3">Play Song</a>





4.2.2 Using <audio> ELement

Please note that the <audio> element is an HTML 5 element, unknown to HTML 4, but it works in all new browsers.
<body>
<audio controls="controls">
  <source src=" audio/problem.ogg" type="audio/ogg" />
  <source src=" audio/problem.mp3" type="audio/mpeg" />
Your browser does not support this audio
</audio>
</body>

4.2.3 Using <object> element

The purpose of the <object> tag is to embed multimedia elements in HTML pages. The following code fragment displays an MP3 file embedded in a web page.

<object height="50px" width="100px" data=" audio/problem.ogg" />





4.2.4 Using the <embed> element
Please note that the <embed> element is an HTML 5 element, unknown to HTML 4 and it might require plug-in in some browsers.
<embed height="50px" width="100px" src=" audio/mela.mp3" />


4.3 Adding video

When you want to play a video on the web there are two things you need to consider:

File format: You need to choose the format of the video, and there are lots of different formats to choose from, including SWF, AVI, FLV, MPEG, QuickTime, and Windows Media. Which format you choose can influence the size of the file that users have to download and the quality of the picture they get to watch (because the formats use different compression techniques to create smaller files).

Plug - in needed to play that type of file: Different formats require different plug-ins to play the movie. Some plug-ins are more popular than others (and are installed on a greater percentage of computers). Examples include Flash Player, QuickTime Player, RealPlayer, and Windows Media Player.

4.3.1 Using a hyperlink
If a web page includes a hyperlink to a media file, most browsers will use a "helper application" to play the file. The following code fragment displays a link to an swf file. If a user clicks on the link, the browser will launch a helper application to play the file.
 <a href="video/perform.swf">Play Video</a>


4.3.2 Using <object> and <embed>
Here is how to add video using <object> element.


<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="200" codebabse="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
    <param name="movie" value=" video/sample.swf">
    <param name="play" value="true">
    <param name="loop" value="false">
    <embed src=" video/sample.swf" width="300" height="200" play="true" loop="false" quality="best" menu="false" type="application/x-shockwave-flash" pluginpage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
</object>

The classid attribute is there to specify which application should play the file (in this case the classid attribute identifies the Flash Player, but if you wanted to play a file using the Windows Media plug - in, you would use a different value of 6BF52A52 - 394A - 11D3 - B153 - 00C04F79FAA6 ). The codebase attribute specifies where the plug - in or program required to play this file can be found if the user does not have it installed.




4.3.3 Using <video> tag

The <video> element is new in HTML 5. The purpose of the <video> tag is to embed video elements in HTML pages. The following HTML fragment displays a video in ogg, mp4, or webm format embedded in a web page:

<video width="320" height="240" controls="controls">
  <source src="video/sea.mp4" type="video/mp4" />
  <source src=" video/sea.ogg" type="video/ogg" />
  <source src=" video/sea.webm" type="video/webm" />
Your browser does not support the video tag.
</video>


4.3.4 Embedding you tube video

One of the easiest ways to feature video on your site is to upload your video to a site such as YouTube, and then embed the YouTube player in your page using the code YouTube provides.

<body>
  <h1>Embedding a YouTube Video</h1>
 <object width="300" height="200">
<param name="movie" value="http://www.youtube.com/v/dMH0bHeiRNg&hl=en&fs=1"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>

<embed src="http://www.youtube.com/v/dMH0bHeiRNg&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="200"></embed>
</object>
</body>


Wednesday, July 4, 2012

Lesson 1 day 3

Lesson 1 day 3

Hello dears how are you all hope you’ve practiced my previous lessons. Dears today we will discus about Presentation Elements.
Presentation Elements: If you use a word processor, you will be familiar with the ability to make text bold, italic, or underlined; these are just three of the ten options available to indicate how text can appear in XHTL. The full list is bold, italic, underlined, strikethrough, teletype(monospaced) etc. Let’s start by meeting the <b>,<i>,<u>,<s>,<tt> elements.
The <b>(bold) tag: Anything that appears in a <b> element is displayed in bold.
The <i> (italic) tag: The content of an <i> element is displayed in italic text.
The <u> (underline) tag: The content of an <u> element is underlined.
The <s> (strikethrough) tag: The content of a <s> element is displayed with a strikethrough.
The <tt> (taletype)tag: The content of a <tt>  element is written in monospaced font (like that of a teletype machine)
Now have some exercise . Try these in a notepad
All HTML code type in notepad
<html>
<head>
<title> Presentation Elements 1 </title>
</head>
<body>
     <p> The following word uses a <b> Bold</b> typeface.</p>
    <p> The following word uses an <i> Italic </i> typeface.</p>
    <p> The following word uses an <u> Underlined </u> typeface.</p>
    <p> The following word uses a <s> Strikethrough </s> typeface.</p>
   <p> The following word uses a <tt>  Monospaced </b> typeface.</p>
</body>
</html>
Save as pp6.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp6.html
See the change



The <sup> (superscript)tag: The content of a <sup>element is written is superscript; ith is displayed half a character’s height above the other characters and is also often slightly smaller than the text surrounding it.
The <sub> (subscript) tag : The content of a <sub> element is written in subscript; it is displayed half a character’s height beneath the other characters and is also often slightly smaller than the text surrounding it.
The <big> tag :  The <big> element is one of several font style elements in HTML 4 renders its content in the next font size larger than the previous body font size. If you nest<big>element, the effects on the more nested elements are cumulative, with each nested level rendered one size larger than the next outer element.
The <small> tag : element renders its content in a relative size one level smaller than the text preceding the element.
The <hr/> tag : The <hr/> element draws a horizontal rule according to visual rules built into the browser with a variety of attribute controls. As a block element, the <hr/> element starts and ends its rule on its own line, as if the element were surrounded by <br> elements.
Try these in a notepad
All HTML code type in notepad
<html>
<head>
<title> Presentation Elements 2 </title>
</head>
<body>
     <p><b> Superscript Text:</b> Written on the 31<sup>st</sup> May  .</p>
    <p><b> Subscript Text:</b> The EPR paradox<sub>2</sub>was devised by Einstein, Podolsky and                                           Rosen.</p>
   <p><b>Bigger Text:</b> The following word should be <big>Bigger </big> than those around it.</p>
  <p> <b> Smaller Text:</b> The following word should appears <small>smaller </small> than those around                     it.</p>
  <p><b> Horizontal Rule:</b> Beneath this paragraph the page will finish with a horizontal rule .</p>
</body>
</html>
Save as pp7.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp7.html
See the change



Ok no more today practice all of these. And next day will learn how to Markup text, list and grouping.
Till then bye bye…………

Lesson 1 day 3

Hello dears how are you all hope you’ve practiced my previous lessons. Dears today we will discus about Presentation Elements.
Presentation Elements: If you use a word processor, you will be familiar with the ability to make text bold, italic, or underlined; these are just three of the ten options available to indicate how text can appear in XHTL. The full list is bold, italic, underlined, strikethrough, teletype(monospaced) etc. Let’s start by meeting the <b>,<i>,<u>,<s>,<tt> elements.
The <b>(bold) tag: Anything that appears in a <b> element is displayed in bold.
The <i> (italic) tag: The content of an <i> element is displayed in italic text.
The <u> (underline) tag: The content of an <u> element is underlined.
The <s> (strikethrough) tag: The content of a <s> element is displayed with a strikethrough.
The <tt> (taletype)tag: The content of a <tt>  element is written in monospaced font (like that of a teletype machine)
Now have some exercise . Try these in a notepad
All HTML code type in notepad
<html>
<head>
<title> Presentation Elements 1 </title>
</head>
<body>
     <p> The following word uses a <b> Bold</b> typeface.</p>
    <p> The following word uses an <i> Italic </i> typeface.</p>
   <p> The following word uses an <u> Underlined </u> typeface.</p>
  <p> The following word uses a <s> Strikethrough </s> typeface.</p>
  <p> The following word uses a <tt>  Monospaced </b> typeface.</p>
</body>
</html>
Save as pp6.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp6.html
See the change

The <sup> (superscript)tag: The content of a <sup>element is written is superscript; ith is displayed half a character’s height above the other characters and is also often slightly smaller than the text surrounding it.
The <sub> (subscript) tag : The content of a <sub> element is written in subscript; it is displayed half a character’s height beneath the other characters and is also often slightly smaller than the text surrounding it.
The <big> tag :  The <big> element is one of several font style elements in HTML 4 renders its content in the next font size larger than the previous body font size. If you nest<big>element, the effects on the more nested elements are cumulative, with each nested level rendered one size larger than the next outer element.
The <small> tag : element renders its content in a relative size one level smaller than the text preceding the element.
The <hr/> tag : The <hr/> element draws a horizontal rule according to visual rules built into the browser with a variety of attribute controls. As a block element, the <hr/> element starts and ends its rule on its own line, as if the element were surrounded by <br> elements.
Try these in a notepad
All HTML code type in notepad
<html>
<head>
<title> Presentation Elements 2 </title>
</head>
<body>
     <p><b> Superscript Text:</b> Written on the 31<sup>st</sup> May  .</p>
    <p><b> Subscript Text:</b> The EPR paradox<sub>2</sub>was devised by Einstein, Podolsky and                                           Rosen.</p>
   <p><b>Bigger Text:</b> The following word should be <big>Bigger </big> than those around it.</p>
  <p> <b> Smaller Text:</b> The following word should appears <small>smaller </small> than those around                     it.</p>
  <p><b> Horizontal Rule:</b> Beneath this paragraph the page will finish with a horizontal rule .</p>
</body>
</html>
Save as pp7.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp7.html
See the change

Ok no more today practice all of these. And next day will learn how to Markup text, list and grouping.
Till then bye bye…………

Sunday, June 24, 2012

Lesson 1, day2


Dear learners Nabin here again. We have learned to install Xampp for local host from previous post. Now we’ll learn the primary lesson how work with html.
What goes into a web page?
Document Type Definition (DTD) precedes any document tags and exists t inform client browsers of the format of the following content, what tags to expect, methods to support, and elements, definitions, events, and so on associated with the document type.
So dears lets start with a page>>
First create a folder to c/xampp/htdocs with any name you like.where we’ll do our job. Than create a notepad document.




Tag and Elements:
 To understand the markup, you need to look at what is written between the angle brackets. The two brackets and all of the characters between them are known as a tag. A pair o tags and the content these include are known as an element.
Element
<h1>About Google </h1>
Opening                    Closing
  tag                               tag

 
 


All HTML documents have three, document =level tags in common. These tags, <html>,<head> and <body>, delimit certain sections of the HTML document.
The <html> tag:
The <html> tag surrounds the entire HTML document. This tag tells the client browser where the document begins and ends.
<html>
….document contents…
</html>
The html element is the container of the entire document content, including the head element. Typically, the html element strat tag is the second line of an Html file, following the document type definition (DTD) is provided  in the file, the html start tag becomes the first line of the file, The end tag should be in the last line of the file. Although the html element doesn’t render per se, it is the root positioning context of a document I a purely W3C- compliant environment.]
The<head> tag:
The <head> tag delimits the heading of the html document. The heading section of the document contains certain heading information for the document. The document’s title , meta information , and in most cases, document scripts are all contained in the <head> section.
The head element contains document information that is generally not rendered as part of the document I the browser window. At most, A browser displays the title element’s content in the browser window’s title bar.
The content of the head of the head element consists entirely of other elements that are intended to assist search engines and document parsers to learn more about the document based on abstract information supplied by the author.


Lets try this on a notepad right same as below

and save as head.html in c\xampp/hotdocs/yourcreated folder name/


Now open your web browser and type on address bar ‘localhost/folder name where you saved notepad/head.html’


Click ‘enter’ and see the change as like


The <Body > Tag:
After all of the material in the head portion of an HTML file, the body element contains the genuine content of the page that the user sees in the browser. Before style sheets, the body was the place where page authors could specify document wide color and background schemes. Agreat many favorite attributes covering these properties are deprecated I HTML4,  in favor of style sheet rules that may be applied to the body element.
All HTML code type in notepad
<html>
<head>
<title>Document Title</title>
</head>
<body>
This would be the thing to go in the website.
</body>
</html>
Save as pp.html
Now open your web browser write on address bar: localhost/html/pp.html
See the change


We can have a web page now and let us the following example:
All HTML code type in notepad
<html>
<head>
<title>Popular Websites: Google</title>
</head>
<body>
Google is best known for its search engine, although Goolge now offers a number of other services. The mission of Google is to organize the information of the world and make it universally accessible and useful. Its founder Larry Page and Sergey brin started at Stanford University.
</body>
</html>
Save as pp1.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp1.html
See the change



Elements for marking Up Text
Elements to describe the structure of text are:
·        The six levels of headings:<h1>, <h2>, <h3>, <h4>, <h5>, <h6>
·        Paragraphs <p>, preformatted sections<pre>, line breaks<br/>, and addresses<address>
·        Presentational elements: bold <b>, italic <i>, underline <u>, <tt>, super script <sup>, subscript  <sub>, <strike>, <big>,<small>, and<hr/>
·        Phrase elements such as <em>, <strong>, <abbr>, <acronym>, <dfn>, <blockquote>, <q>, <cite>, <code>, <kbd>, <var>, <samp>, and <address>
·        List such as unordered lists using <ul> and <li>, ordered lists using <ol> and <li>, and definition lists using<dl>. <dt>, and <dd>
·        Editing elements such as <ins> and <del>
·        Grouping elements such as <div>, and <span>
The Heading elements:
No matter what sort of document you are creation , Most documents have headings in one form of another.
Now try this on notepad:
All HTML code type in notepad
<html>
<head>
<title>Popular Websites </title>
</head>
<body>
<h1> About Google</h1>
<h2>About Yahoo</h2>
<h3> About Facebook</h3>
<h4> About Bing</h4>
<h5> About Opera</h5>
<h6> About Ask</h6>
</body>
</html>
Save as pp2.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp2.html
See the change



The paragraph <p> Tag
In HTML paragraph are delimited by the paragraph tag <p>. The paragraph tag controls the line spacing of the lines within the paragraph as well as the line spacing between paragraph. The default spacing is single and double space within the paragraph, Each paragraph starts with <p>and close with </p>
All HTML code type in notepad
<html>
<head>
<title>Popular Websites: Google</title>
</head>
<body>
<h1>About Google</h1>
<p>Google is best known for its search engine, although Goolge now offers a number of other services. The mission of Google is to organize the information of the world and make it universally accessible and useful.</p> <p>Its founder Larry Page and Sergey brin started at Stanford University.</p>
</body>
</html>
Save as pp3.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp3.html
See the change



Creating line breaks using<br/>
Whenever you use the <br/> element, anything following it starts next line. You do not need opening and closing tag for this.
Now try this on notepad
All HTML code type in notepad
<html>
<head>
<title>Popular Websites: Google</title>
</head>
<body>
<h1>About line break</h1>
<p>Google is best known for its search engine,<br/>
although Goolge now offers a number of other <br/>services.
The mission of Google is to organize the information <br/>of the world
and make it universally accessible and useful.</p>
<p>Its founder Larry Page and Sergey brin started <br/> at Stanford University.</p>
</body>
</html>
Save as pp4.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp4.html
See the change



Creating preformatted text using the<pre> element.
If you want your text to follow the exact format of how it is written in the HTML document you don’t want the text to wrap onto a new line when it reaches the edge of the browser.
Now try this on notepad
All HTML code type in notepad
<html>
<head>
<title>Popular Websites: Google</title>
</head>
<body>
<pre>
int doIT (int a, int b) {
return a*b;
}
</pre>
</body>
</html>
Save as pp5.html or as you use on local host
Now open your web browser write on address bar: localhost/html/pp5.html
See the change
.

Ok dears no more today next day I will provide you the using of “Presentation Element”.
Stay tuned and practice all of these.
Thank you

Thursday, June 21, 2012

Lesson 1.



Introduction:

Web design A web design incorporates design and graphics that complement the content written for the web pages of a site. The term web design is normally used to describe the design process relation to the front – end (client side) design of a website including writing mark up. Web designers are expected to have an awareness of usability and if their role involves creation markup then they are also expected to be up to date with web accessibility guidelines. A web design of a web page is mainly based on creativity and technologies such as use of HTML, CSS, PHP, and others. A website design is a collective work incorporating all the web pages of a website.

World Wide Web The name WWW is sort of World Wide Web is a network of computers able to exchange text, graphics, and multimedia information via the internet. By sitting at a computer that is attached to the web, one can visit Web – connected computers next door, at a nearby university, of halfway around the world. And one can take full advantage of the resources these computers make available, including text, graphics, videos, sounds, and animation.

Wednesday, June 20, 2012

Introduction of Web Design & Development

Introduction of Web Design & Development 


Hi this is Nabin, and this is my online tutorial project about Web Design & Development. Here I will teach you  step by step how to create a web site using “local host”, HTML tagging, PHP, CSS and more. So no more talking lets start:
Here I am providing you a road map of what I will teach you:

Tutorial Outline: Web Design and Development:

1.     Site architecture (site amp and page layout)
2.     Creating pages with html-1
3.     Creating pages with html-2
4.     Adding Image, Audio And Video
5.     Creating web form
6.     Page layout techniques
7.     Controlling Presentation with CSS
8.     Web graphics
9.     Script and server sede programming with PHP
10. Database
11. Database integration using php-1
12. Database integration using php-2
13. Review