HTML LINKS
In Html, Links are very useful for any website, Links are
used to jumping from one webpage of the website to another webpage of the
website as well as another website. Just click on the given link and reach the
website whose link will be given. All website has links. To make a link we have
to use <a> elements with <href> attribute that specify a URL of a
page or website.
HTML LINK
STRUCTURE
- Start tag :- <a>
- href attribute with URL ex:- href = “www.madaboutcomputer.com”
- Element Content:- Here you can write anything to describe the link you can also use an image here
- End tag :- </a>
Example:
<html>
<head>
<title>
Example of Links </title>
</head>
<body>
<a href =
"https://www.madaboutcomputer.com"> Click Here to Reach Mad About
Computer </a>
</body>
</html>
OUTPUT
Visited Links and Unvisited Links
Unvisited Link
Whenever
you make a new link to your web page when you see it. It appears in the blue
color with an Underline of your Text. This type of link is known as unvisited
links.
Example:-
The above
image is an example of an unvisited link.
Visited Link
If you have
ever created a link to your webpage. Initially, it will look blue, but if you
click on it, it will show you a purple color with an underline on it. These
types of links is known as visited link.
Example:-
By default,
links will appear as follow in all browser:-
- An Unvisited links appear in blue color with an underline.
- A Visited links appear in Purple color with an underline.
- An active link appear in Red color with underline.
TARGET ATTRIBUTE IN HTML LINKS
By default,
whenever you click on a link it will open in the same window. If you want to
change the target of your link means if you want to open the link on a new
window or anything else. Then you have to use the target attribute on your webpage. The target attribute specifies
where your link has been open.
The target
attribute have the following values are:-
- _self – This value is used to open the link on the same window/tab. this is a default value means if you don’t give any specific target value on your link then your link is always open on the same window/tab.
- _blank – This value is used to open your link in a new window/tab.
- _parent – This value is used to open the link in the parent frame
- _top – This value is used to open the link in the full body of the window
Use Image
as a link
In Html links, you can also use any
type of image as a link such as jpg, jpeg, png, gif, etc. Let us see how can
we use an image as a link.
Example:-
<html>
<head>
<title> Example of Links
</title>
</head>
<body>
<a href =
"https://www.madaboutcomputer.com"> <img src =
"C:\Users\Mad About Computer\Pictures\Smiley.png" style=" width:
79px;height: 68px;"></a>
</body>
</html>
OUTPUT:-
Whenever
you click on the image, you will go directly to the website called
www.madaboutcomputer.com
So, that is
for today guys, I hope you liked the Html series if you have any quarries about Html or this article comment the below or DM on my social media handles.
Thanks For
Visiting here.
0 comments:
Post a Comment