|
||
| HTML COURSE FOR EASY LEARNING | ||
| Homepage | lesson-2 | lesson-3 | lesson-4 | lesson-5 | lesson-6 | lesson-7 | lesson-8 | lesson-9 | lesson-10 |
The hyper links are the text or grafhic part that takes to another webpage or part of webpage when mouse is clicked on the link. The Links are written with the help of anchor tags and the anchor tags will look like as follows:-( (<a.....> ...</a> )
Example of a link.
Example:
A link to yahoo.com is written as follows:-
<a href=http://www.yahoo.com/>yahoo!</a> ---This links looks in webpage as -yahoo!!.
if you click on this link you will visit yahoo.com.
If you are just linking to a page in the same directory as your current page, you don't need the domain, Example: the 1.html is a webpage located in the same directory of the present webpage( the webpage right now you are reading) so you can use the code.
<a href="1.html">page1</a>.
this will give the link as page1..
( To test this click on page1 and your browser will open the webpage 1.html which is located in the same directory )
If you want a link to open in a new window, add target="_blank" to the end of the anchor tag, e.g. <a href="http://www.yahoo.com/" target="_blank">yahoo.com</a> this will be displayed as yahoo.com.. when you click on this link the yahoo.com website opens in a new window
Mail link:To send an email a mailto:user@host link is used. This is called as mail link and when you click on the link it will open a mail form to send your mail to the specified email address in the link. Example of a Mailto: Link... . Send email to <a href=mailto:[email protected]>activewebworld</a>! This will be as follows-- Send email to activewebworld!. Navigation within a document
The anchor links are useful to navigate easily within a document and to a certain area of some specified document. This is possible by two steps, first the part of the document to be visited is to be named and in the sencond step the link to be written with a target of reaching the named part of the document.To name the part of the document, go to the area you want to name, and place <a name="name_of_area">text</a>, then to call a link to that place from somewhere else in the document, use <a href="#name_of_area">text</a> Example: Go To story 2(<a href="#story2">Go To story 2</a>) Now study this cats chapter(<a name="story1">Now study this cats chapter</a>)
Mr.Robert is coming here lmage as a linkIf the displaying text between two anchor tags is replaced by an image tag then the image becomes a link. For example you take the following link <a href="1.html">page1</a> In this link if you replace the page1 with the image link <img src="fruit.jpg"> the fruit will become a link to page1. <a
href="http://www.yahoo.com"><img src="fruit.jpg" WIDTH=99 HEIGHT=101 ALT="image of a fruit"align=right></a>this will be viewed as follows:- . This fruit image is a link to yahoo.com if you click on this fruit image this will take you to the yahoo website. Imagesthe Image is expressed with the following tag <img src="image.ext" width=x height=x border=x alt="x"align=left/right> Only the .gif and .jpg and.jpeg type of images are supported by html.(The IMG tag has no closing tag!) the following image is in the same directory of this webpage so we can just use the image name. fruit.jpg, as <img src="fruit.jpg"> Then add the appropriate height, width, and alt attributes. The alt attribute defines the alternative text to be displayed if image is not loaded. Example of an image: <img src="fruit.jpg" WIDTH=99 HEIGHT=101 ALT="image of a fruit"> ![]() Image alignment in a textIf the image is left aligned then the text after the image tag will be adjusted to the rightside of the image and if the image is aligned to right the text after the image tag will be adjusted to the left side of the image. If the align attribute is missed then the text after the image tag will not be adjusted. So it is necessary to define the alignment of the image. <img src="fruit.jpg" WIDTH=99 HEIGHT=101 ALT="image of a fruit"> This is an image of a fruit<br>the best for good health. If you write this code the image and text will look like as follows(note: here the align attribute is missed and look the above text is written after the image tag):- This is an image of a fruit the best for good health. To start the text from the top of the image the align attribute is necessary, and follow the example: <img src="fruit.jpg" WIDTH=99 HEIGHT=101 ALT="image of a fruit"align=�left�> This is an image of a fruit <br>the best for good health. If you write this code the image and text will look like as follows:- This is an image of a fruit the best for good health To avoid such problem the use of <br clear="all"> is necessary. If you use this <br clear="all"> tag then the text after the image will start after the image.(ie the text will not be adjusted by the side of the image) <img src="fruit.jpg" WIDTH=99 HEIGHT=101 ALT="image of a fruit"> <br clear=�all�> This is an image of a fruit <br>the best for good health. If you write this code the image and text will look like as follows:- ![]() This is an image of a fruit the best for good health, SoundsThe <EMBED >tag is used to add sounds to webpages. This tag supports many common file formats... such as .wav, .mid, and .au. the structure of the tag is as follows<embed src="filename.ext" width=x height=x autoplay=x hidden=x loop=x volume=x></embed> If you want the file to automatically play when the web page is loaded, set autoplay=true, if you do not want the file to automatically start, set autoplay=false. If you want the control box to be hidden, use the hidden=true attribute. Normally the file will stop playing after it is completed the first time, so if you want it to start over once it is done use the attribute loop=true. You can set the volume setting with the volume attribute, a value from 1 to 100 (default is 50). Example of the embed tag... <embed src="apari.mid" loop="true" autoplay="false" width="180" height="60"></embed> |