Linking is used for linking the web page with the another web page. One can create linking with <a> </a> tag. It is also called anchor tag. One can create linking with the text, linking with the image.
The attribute of <a></a>
<html>
<head>
<title>
linking with text
</title>
</head>
<body>
<a href="file:///C:/Program%20Files/Java/jre1.8.0_31/Welcome.html">click here</a>
</body>
</html>
The output of the above code is
Now, one can also create linking with the image.
Example
<html>
<head>
<title>
linking with image
</title>
</head>
<body>
<a href="file:///C:/Program%20Files/Java/jre1.8.0_31/Welcome.html">
<img src="C:\Users\Public\Pictures\Sample Pictures\Desert.jpg" width=200 height=200 alt="hello" align="left">
</a>
</body>
</html>
The output of the above code is
<title>
he</title>
</head>
<body>
<a href="#a">bottom</a>
<a name="b"></a>
<img src="C:\Downloads\imagesman.jpeg">
<a href="#b">top</a>
<a name="a"></a>
</body>
</html>
The attribute of <a></a>
- href="path"
- target="frame name" or _top or _blank or _self or _parent
Linking with the Text
One can create linking with the text. Example of it is given below
Example
<html>
<head>
<title>
linking with text
</title>
</head>
<body>
<a href="file:///C:/Program%20Files/Java/jre1.8.0_31/Welcome.html">click here</a>
</body>
</html>
The output of the above code is
Linking with Image
Example
<html>
<head>
<title>
linking with image
</title>
</head>
<body>
<a href="file:///C:/Program%20Files/Java/jre1.8.0_31/Welcome.html">
<img src="C:\Users\Public\Pictures\Sample Pictures\Desert.jpg" width=200 height=200 alt="hello" align="left">
</a>
</body>
</html>
The output of the above code is
Linking in Same Page
Now, question arises how to create the linking in same page.
Example
<HTML>
<head><title>
he</title>
</head>
<body>
<a href="#a">bottom</a>
<a name="b"></a>
<img src="C:\Downloads\imagesman.jpeg">
<a name="a"></a>
</body>
</html>
The output of the above example is
Comments
Post a Comment