Jump to content

HTML Anchor ( Anchor آشنایی با مفهوم )


Recommended Posts

  • Author

HTML Anchor

The HTML anchor tag defines a hyperlink that links one page to another page. It can create hyperlink to other web page as well as files, location, or any URL. The "href" attribute is the most important attribute of the HTML a tag. and which links to destination page or URL.

href attribute of HTML anchor tag

The href attribute is used to define the address of the file to be linked. In other words, it points out the destination page.

The syntax of HTML anchor tag is given below.

<a href = "..........."> Link Text </a>

Let's see an example of HTML anchor tag.

  1. <a href="second.html">Click for Second Page</a>  

Test it Now

Specify a location for Link using target attribute

If we want to open that link to another page then we can use target attribute of <a> tag. With the help of this link will be open in next page.



 <a href="https://www.adrianbahmani.com">adrianbahmani</a>

Linked image

<p>بروی تصویر زیر کلیک کنید</p>
<a href="https://www.adrianbahmani.com">
 <img src="images/logo-1.png">

Link to email

<a href="[email protected]?subject=test&body=test" target="_top">ارسال ایمیل</a>

Link to phone number

<a href="tel:+98۰۰۰۰۰">تماس تلفنی با ما</a>

Link to the top of the page

<!DOCTYPE html>
<html id="Top">
 <a href="#Top">برو بالای صفحه</a>



 <a href="https://Test.com/" rel="nofollow">Test.com</a>


Interesting link

<div style="text-align:center;">
 <a href="https://www.adrianbahmani.com/">adrianbahmani.</a>
 <a href="https://www.adrianbahmani.com/">adrianbahmani.</a>
 <a href="https://www.adrianbahmani.com/">adrianbahmani.</a>

Opening the link in different modes

<a href="https://www.adrianbahmani.com" target="_self">Self</a> <br>
<a href="https://www.adrianbahmani.com" target="_blank">Blank</a> <br>
<a href="https://www.adrianbahmani.com" target="_parent">Parent</a> <br>
<a href="https://www.adrianbahmani.com" target="_top">Top</a>


Link to comment
Share on other sites

  • Adrian changed the title to HTML Anchor ( Anchor آشنایی با مفهوم )

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...