ad

Showing posts with label HTML Links. Show all posts
Showing posts with label HTML Links. Show all posts

Friday, 14 March 2014

HTML Links


                           HTML Hyperlinks (Links)

The HTML <a> tag defines a hyperlink.
A hyperlink (or link) is a word, group of words, or image that you can click on to jump to another document.
When you move the cursor over a link in a Web page, the arrow will turn into a little hand.
The most important attribute of the <a> element is the href attribute, which 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

HTML Link Syntax

The HTML code for a link is simple. It looks like this:
<a href="url">Link text</a>
The href attribute specifies the destination of a link.

Example

<a href="http://www.programmingpassion07.blogspot.com/">Visit Programming Passion</a>
which will display like this: Visit Programming Passion
Clicking on this hyperlink will send the user to W3Schools' homepage.
Tip: The "Link text" doesn't have to be text. It can be an image or any other HTML element.
As like facebook images these images are also links, you can use others things also.

HTML Links - The target Attribute

The target attribute specifies where to open the linked document.
The example below will open the linked document in a new browser window or a new tab:

Example

<a href="http://www.programmingpassion07.blogspot.com/" target="_blank">Visit Programming Passion</a>

You can try it yourself in your desktop.


HTML Links - The id Attribute

The id attribute can be used to create a bookmark inside an HTML document.
Tip: Bookmarks are not displayed in any special way. They are invisible to the reader.

Example

An anchor with an id inside an HTML document:
<a id="tips">Useful Tips Section</a>
Create a link to the "Useful Tips Section" inside the same document:
<a href="#tips">Visit the Useful Tips Section</a>

Thursday, 13 March 2014

HTML Basic

HTML Headings

HTML headings are defined with the <h1> to <h6> tags.

Example

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>

Try it yourself »


HTML Paragraphs

HTML paragraphs are defined with the <p> tag.

Example

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

Try it yourself »


HTML Links

HTML links are defined with the <a> tag.

Example

<a href="http://www.programmingpassion07.blogspot.com">This is a link</a>


Note: The link address is specified in the href attribute.
(You will learn about attributes in a later chapter of this tutorial).

HTML Images

HTML images are defined with the <img> tag.

Example

<img src="wtp.jpg" alt="Sparsh" width="104" height="142">
here the height and width will give the dimension of the image. The attribute which are specified here according to those the image will be displayed.