HTML Links

How to Add a Link HTML?

A link connects one web resource with another. For instance, a user might want to view a video that is on a different webpage from the one that he is currently viewing? if a link to it is available on his current page, he can use it to connect directly without copying and pasting the video URL on his address bar. A link’s major properties are two anchors and their direction. The source anchor is represented by the webpage from which a link originates. It points to the destination anchor or the webpage where a video, image, or another HTML document is located.

HTML5 Elements

The default color codes are blue for unvisited links, purple for visited links, and red for an active link although you can style yours differently using cascading styles sheets (CSS). Use the <a> tag to specify a link in your HTML document. Note that a link can be a word, a phrase, or an image. Below is the syntax for a link and an example that illustrates it.

How to Add a Link HTML Example

<a href=?url?>Text link</a>

<a href=”https://htmlkick.com“>Tutorial HTML Kick</a>

A target attribute of a link indicates to a browser, where it should open it. In HTML 5, the only relevant target is _Blank, which opens a link in a new tab or window. Earlier versions of HTML supported targets like _parent, _self, and _top that were used to specify frames but they have since been deprecated.

Use the id attribute whenever you need to create a bookmark inside a webpage. Note that download links are created the same way text links are created. However, download links that point to pdfs or images first open the files in the browser after which a user can take further action of saving them to a computer’s hard drive.

Link CSS class

<style>
a:link {color:green; background-color:transparent; text-decoration:none}
a:visited {color:pink; background-color:transparent; text-decoration:none}
a:hover {color:red; background-color:transparent; text-decoration:underline}
a:active {color:yellow; background-color:transparent; text-decoration:underline}
</style>

What is HTML Elements in HTML5? | HTML KICK

 

Join Telegram Join Whatsapp