HTML Basics: Inserting Links








When used properly, links can greatly enhance a website’s design as well as its usability.  HTML coding can allow you to insert links to other pages on your site, email servers, or other webpages entirely.

Links that are coded in HTML do not appear as a string of URL text, but instead, they are integrated into the text.  This is known as using anchor text.

Example:

www.examplesite.com/page1.html

Page 1

You can insert links using the tag.

Anchor Text

Page 1

When a user clicks on the anchor text, it will take them to the specified hyperlink.  Anchor text does not always need to be actual text, but can be images or other elements.

Example:

image1.jpg

Image1.jpg will be inserted into the page.  If a user clicks on the image, it will act as a hyperlink taking them to the specified URL.

In addition, you can specify how a link opens up to a reader.  By default, links will open in the same window when clicked, but adding the target attribute will allow you to specify that any links clicked will open in a new window.

target="_blank
">Page 1>
HTML code can also be used to link to email.  To link to email, users need to have a desktop mail server installed.  Email links use the “mailto:” attribute inside the tag.Email Me


This will create a link: Email Me

This link will take the user to his/her email server and automatically insert the specified email address and subject line.  If you use more than one word in the subject= attribute, separate each with %20 to make sure the text is formatted properly.  You can also choose to automatically CC or BCC other emails or add body text in the email by adding those attributes into your tag.

Email Me



If you've any question, problem, suggestion and feedback than please comment below.

Have a nice day!






Comments