Sunday 13 September 2020

#10 HTML Links


link is simply an address that specifies the location of a resource on the Internet just like an URL which takes you to the web pages identified by the linked URLs. 

Hyperlinks, on the other hand, are links that you can click on or activate with a pointing device in order to jump to the target page.

HTML Links  

The HTML <a> tag defines a hyperlink. The href attribute indicates the link's destination.By default, links will appear as follows in all browsers :

  • An unvisited link is underlined and blue.
  • A visited link is underlined and purple
  • An active link is underlined and red
❗Using CSS we can style the links !!!


⭐Example of a HTML Link:



HTML Links - target Attribute 

By default, the linked page will be displayed in the current browser window. To change this , we must specify another target for the link.

The target attribute specifies where to open the linked document . The target attribute can have one of the followings values :

  •  _self - Default , Opens the document in the same tab as it was clicked.

  • _blank - Opens the document in a new window or tab.

  • _parent - Opens the document in the parent frame .

  • _top - Opens the document in the full body of the window.

⭐Example of a HTML Links with the target attributes :




Absolute URL & Relative URL

Absolute URL is a full web address in the href attribute.

Relative URL is a local link i.e. link to a page within same website .


❗Link to a page (or file) located in Absolute URL & Relative URL is same as we organize files in website.. Previous post resolve this problem go checkout the post.. 

Link is here 🔗Click here !

⭐Example of Absolute URL and Relative URL :










❗We cover the basics of HTML Links , but HTML Links can be used as following listed below :-
  • An image as a Link
  • Link to an Email Address
  • Button as a Link
⭐Examples as above listed :





⭐Extras on HTML Links - Link Titles , Bookmarks :

The title attribute specifies extra information about an element. The information is shown when the mouse hover the text .

             

Bookmarks are generally useful for a very long web page. To create bookmark ,first create the bookmark  using id attributes and then add link to it using  href attributes.This will be discussed later with more examples.

Uses of Bookmarks :
  • We can easily navigate a very long web page  using bookmark. 
  • We can also navigate from one page to another page using bookmark.   







=======================================================================

📌Here is Codepen link of above examples :- ðŸ”—https://codepen.io/arwazkhan189/pen/qBZKOag


Next we will learn about HTML Images  ...

Keep Learning and practice , practice and practice.. !!!

Follow me on Codepen ðŸ”—https://codepen.io/arwazkhan189

LIKE , COMMENT , SHARE , SUBSCRIBE  the Blog!

No comments:

Post a Comment