Friday 2 February 2018

HTML - Anchor Tag


What is an Anchor Tag?

An anchor tag is an HTML tag. It is used to define the beginning and end of a hypertext link. It contains visible words within a text that can be clicked and the URL of the link's target. Search engines use this HTML tag in order to determine the subject matter of the linked target.

How to build a Hyperlink with an Anchor Tag


<a href="https://basic-to-expert-development.blogspot.com">My Blog</a>

An Anchor tag is defined with '<a>' and consists of three parts,but we study only two parts of Anchor Tag:


  • the href attribute,
  • and the target attribute.

href attribute

To create a hyperlink, the destination (address) of the document must be known. A hyperlink can link to pages on your own domain, to other websites.
If you want to link to the Google homepage, the code looks as follows from:
<a href="http://www.google.com">Google Home</a>
Href is short for hypertext reference. This attribute defines the target address of the document, which is to be linked to (http://www.google.com). The “=” sign is the connection of the attribute with the attribute value, whereby “href” is the attribute and “ http://www.google.com ” is the attribute value. There is an apostrophe before and after the attribute value. The defined phrase “Google Home” is called anchor text or link text. This part is clickable in the text. An anchor text is ideally informative and relevant to the landing page.
If you want to link internally to another part of your website, you don’t have to specify the full address, the filename is sufficient:
<a href="MyPage.html">My Page</a>
If you use the full address, it can cause the page to load slowly.

Target attribute

The target attribute specifies how the destination page or the target document should be opened. (target = "  _ blank " ) is used for opening of the target page in a new window. This is the usual option when using target attributes for linking to other pages.
<a href="http://www.mypage.com" target="_blank">Linktext</a>


Sunday 28 January 2018

HTML - Overview


HTML stands for Hypertext Markup Language, and it is the most widely used language to write Web Pages. 
  • Hypertext refers to the way in which Web pages (HTML documents) are linked together. Thus, the link available on a webpage is called Hypertext. 
  • As its name suggests, HTML is a Markup Language which means you use HTML to simply "mark-up" a text document with tags that tell a Web browser how to structure it to display. 

Originally, HTML was developed with the intent of defining the structure of documents like headings, paragraphs, lists, and so forth to facilitate the sharing of scientific information between researchers.

Now, HTML is being widely used to format web pages with the help of different tags available in HTML language. 

Basic HTML Document 

In its simplest form, following is an example of an HTML document:




Let's save it in an HTML file Heading.html using your favorite text editor. Finally open it using a web browser like Internet Explorer or Google Chrome, or Firefox etc. It must show the following output: 

HTML Tags

As told earlier, HTML is a markup language and makes use of various tags to format the content. These tags are enclosed within angle braces . Except few tags, most of the tags have their corresponding closing tags. For example, has its closing tag and tag has its closing tag tag etc. Above example of HTML document uses the following tags: 





HTML - Anchor Tag

What is an Anchor Tag? An anchor tag is an HTML tag. It is used to define the beginning and end of a hypertext link. It contains visib...