Monday, March 20, 2017

Links and Other HTML in Comments

Links pasted into comments are not "live." That is, if you click on the following link, it will not take you to Google

http://www.google.com

The link will, however, work if you copy and past it into the address window of your browser.

To insert a working link in a comment, you must use the HTML anchor tags <a> and </a>. For example, if you want to include a live link as follows,  "Go here to the Google home page," you must use the anchor tags and write, "Go <a href="http://www.google.com">here</a> to the Google home page."

An opening a tag contains <a href="[any web address]">, and the address must be in quotes. The words following the opening tag will be highlighted in some way to indicate they can be clicked on as a link, and the closing tag </a> determines the end of the highlighting for the link.

The other HTML tags permitted in comments are as follows

<em> emphasis
<b> bold
<i> italics

They must all have end tags. I will illustrate the use of all five tags in a comment to this post. (Posts are written with a WYSIWYG ("what you see is what you get") editor instead of embedded HTML codes.

Go <a href="http://www.google.com">here</a> to the Google home page.
<em>This is an example of emphasized text.</em>
<b>This is an example of bold text.</b>
<i>This is an example of italic text.</i>

1 comment:

  1. Go here to the Google home page.
    This is an example of emphasized text.
    This is an example of bold text.
    This is an example of italic text.

    ReplyDelete