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

Monday, December 31, 2018

A mailto link with subject

A mailto link with subject:-   

<!DOCTYPE html>
<html>
<body>

<p>
This is another mailto link:
<a href="mailto:someone@example.com?cc=someoneelse@example.com&bcc=andsomeoneelse@example.com&subject=Summer%20Party&body=You%20are%20invited%20to%20a%20big%20summer%20party!" target="_top">Send mail!</a>
</p>

<p>The link will only work if you have email installed.</p>

<p>(Spaces between words should be replaced by %20 to ensure that the browser will display the text properly)</p>

</body>
</html>

OUTPUT:-    

  • The link will only work if you have email installed.

A mailto link

A mailto link:- 


<html>
<body>

<p>
This is an email link:
<a href="mailto:someone@example.com?Subject=Hello%20again" target="_top">
Send Mail</a>
</p>

<p>The link will only work if you have email installed.</p>

<p>(Spaces between words should be replaced by %20 to ensure that the browser will display the text properly)</p>

</body>
</html>

OUTPUT:-

Breaks out of a frame

A link that breaks out of a frame:-   

<html>
<body>

<p>Locked in a frame? <a href="https://www.google.com/html/" target="_top">Click here!</a></p>

</body>
</html>

OUTPUT:-



   

Sunday, December 30, 2018

An image as a link

An image as a link:- 


<html>
<body>

<h1>Image Links</h1>

<p>The image is a link. Click on it.</p>

<a href="part.asp">
  <img src="bad.gif" alt="HTML studio" style="width:32px;height:32px;border:0">
</a>

<p>We have added "border:0" to prevent IE9 (and earlier) from displaying a border around the image.</p>

</body>
</html>

OUTPUT:- 
  • We have added "border:0" to prevent IE9 (and earlier) from displaying a border around the image.
  • It is common to use images as links.

Changing the target.

Changing the target of a link:-


<html>
<body>

<h1>The target Attribute</h1>

<a href="https://www.google.com/html/" target="_blank">Visit all things!</a>

<p>If you set the target attribute to "_blank", the link will open in a new browser window or tab.</p>

</body>
</html>

OUTPUT:-   
  • If you set the target attribute to "_blank", the link will open in a new browser window or tab.
  • The target attribute specifies where to open the linked document.
  • _blank - Opens the linked document in a new window or tab.
  • _self - Opens the linked document in the same window/tab as it was clicked (this is default).
  • _parent - Opens the linked document in the parent frame.
  • _top - Opens the linked document in the full body of the window.
  • framename - Opens the linked document in a named frame.
  • If your webpage is locked in a frame, you can use target="_top" to break out of the frame.

Removing the underline.

Removing the underline from links:- 


<html>
<body>

<a href="imag.asp" style="text-decoration:none">Imag</a>

</body>
</html>

OUTPUT:-  


Thursday, December 27, 2018

Changing the color of links.

Changing the color of links:-


<html>
<head>
<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>
</head>
<body>

OUTPUT:-  


  • By default, a link will appear like this (in all browsers).
  • An unvisited link is underlined and blue.
  • A visited link is underlined and purple.
  • An active link is underlined and red.

Linking, using a relative URL

Linking, using a relative URL:-


<html>
<body>

<h2>Local Links</h2>

<p><a href="imag.asp">Imag</a> is a link to a page on ORDER website.</p>

<p><a href="https://www.COOL.org/">COOL</a> is a link to a website on the World Wide Web.</p>

</body>
</html>

OUTPUT:- 


  • A local link (link to the same web site) is specified with a relative URL (without https://www....).

Linking, using an absolute URL

Linking, using an absolute URL:-


<html>
<body>

<h2>HTML Links</h2>
<p><a href="https://www.Google.com/html/">Visit all things. </a></p>

</body>
</html>

OUTPUT:-

Internal Javascripts

Internal Javascripts :    The script code can be written directly into the HTML document. script code is placed in header of the docume...