Skip to main content

Linking in html

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>
  • 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

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

 


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 href="#b">top</a>
<a name="a"></a>
</body>
</html>


The output of the above example is 



NEXT

Comments

Popular posts from this blog

Lists in HTML - Unordered List

Unordered List An Unordered List is a collection of item that is not  in sequential order. It starts with the <ul> tag and ends with the </ul> tag. Each list item starts with the <li> tag. Each item is marked with the bullet i.e . with the disc or square or circle.  By default the tag starts with the disc . It is also called Bulleted list. Tags of Unordered List <ul> </ul> <li></li> Example    Write a  program to print the list given below pen pencil book <html> <head> <title> unordered list </title> </head> <body> <ul> <li>pen</li> <li>pencil</li> <li>book</li> </ul> </body> </html> Example of Attributes of <ul> tag with the Type attributes Write a program to print the list given below <html> <head> <title> unordered list </title> </head...

HTML FRAMES - HTML Frames Example with Output

Post Updated :16-02-2018 HTML Frames is used to display more than one file. It is used to divides the browser window into different parts or sections  i.e.  row-wise or column-wise or row and column-wise . Each section can display HTML files.To create a frame  two tags are used they are <frameset> and <frame> tag. Attributes of  <frameset>    tag 1. Cols=value is % or pixels 2. Rows= values in % or pixels Attributes of <frame> tag 1. Src= "path" 2. Name="name of the frame" 3. Border= value in pixels 4. Noresize 5. Scrolling="true" or "false" 6. Marginwidth=value in % or pixels 7. Marginheight=value in % or pixels If I want to divide the browser into two columns. The following example will be used to divide the window into 2 section. In the example given below we are using to divide the browser into equal sections i.e. 50% each. HTML Frames Example with Output Simple example of two- framed page ...

HTML WEB PAGE DESIGN - How to Create simple HTML web page

How to Design Simple HTML Web page In this article, we are going to learn how to design HTML web page. This article is used to let you know, how to create a simple web page using HTML. With this article you will come to know how to create the simple web page from scratch. To create the web page one should use the editors like notepad or Dreamweaver or Notepad++ etc. Here we are using Notepad ,in this connection steps are initiated to be as following HTML  Web Page Design A web page is a part of a website, containing information about a particular topic. You can create a custom web page using HTML. You can put anything you want on your web page like images, tables, hyperlinks, etc. Open Notepad: To open the Notepad one has to go to Start -> All Programs -> Accessories ->Notepad.  Notepad Once Notepad is open write the coding their as given below 1. <HTML> is the first tag of the web page and you have to write it at the top ...