HTML Links
It consists of anchor element which is used to create a link between a source anchor and destination anchor.
The anchor tag can be embedded between text, image, video, or button.
Example
<a href="https://phpgurukul.com/">PHPGurukul | Programmong Blog</a>
Here. <a> : Anchor tag which add the link to any reference text, image etc.
href (hypertext reference): It specifies the destination for the anchor tag.
- Local Links: It is specified with a relative URL. E.g. php_tutorials.php
- Global Links: It is an absolute URL (Full website address).
HTML Link Colors
The color of the link is distributed into three categories of type of links.
- Unvisited Link: Link is not visited even once i.e. first time color of a link.
- Visited Link: When Unvisited link reaches the destination i.e. color of a link changes if visited.
- Active Link: Link color on click that shows link is working.
<html>
<head>
<style>
a:link { color: red; }
a:visited { color: yellow; }
a:active { color: blue; }
</style>
</head>
<body>
<a href="php_tutorials.php" >PHP tutorials</a></body>
</html>
Link Usage
Text as link
<a href="https://phpgurukul.com/php-tutorials/">PHP Tutorials</a>
Output
PHP TutorialsImage as link
<a href=”https://phpgurukul.com/”><img src=”http://localhost/wordpress/wp-content/uploads/2016/05/phpgurukul-1.png”></a>
Output
Email tag
<a href="mailto:support@phpgrukul.com">Send Mail </a>
Output
Send Mail