This article focuses on the role of hyperlink in a Web page and how to use a Web hyperlink in a text message.
The role of hyperlinks in Web pages
I think, but any friend who is familiar with HTML, must not be unfamiliar with hyperlinks. And today we're going to discuss and use just one of the hyperlinks---page hyperlinks, which link a piece of text to another page using the <a> tag in HTML, as shown in the following example:
<a href= "http://blog.csdn.net/lyq8479" > Liu Feng Blog </a>
Above is a standard HTML code, implements a webpage hyperlink, will "Liu Feng's Blog" 5 Words link to the blog homepage URL, when "Liu Feng's Blog" 5 words, will open http://blog.csdn.net/lyq8479 to point to the webpage.
How to use a Web page hyperlink in a text message
In fact, developers who don't know how to use a Web hyperlink in a text message are almost 100% familiar with HTML, especially the <a> tags in HTML. What's so special about using hyperlinks in the text messages of a micro-credit public account? Why have so many friends ever stumbled on this issue? Let's take a look at two ways to use hyperlinks in a micro-letter:
Error usage 1 (the href attribute value of a label is not quoted):
<a href=http://blog.csdn.net/lyq8479> Liu Feng's blog </a>
Error usage 2 (the href attribute value of a label is enclosed in quotation marks):
<a href= ' http://blog.csdn.net/lyq8479 ' > Liu Feng blog </a>
When doing web development, both of these are possible, but in the text message of the micro-credit public account, both of these are wrong, and the hyperlinks don't work, and the HTML code is displayed as it is on the Android phone, as shown in the following illustration:
The effect on Android phones:
The effect on the iphone:
As you can see, in a micro-letter, HTML's A-tag attribute value is not enclosed in quotation marks, or the use of single quotes, is the wrong wording (on the iphone, the value of a tag attribute href is normal in single quotes). The correct use is to enclose the value of the a label href attribute in double quotes, as follows:
<a href= "http://blog.csdn.net/lyq8479" > Liu Feng Blog </a>
This allows hyperlinks to be displayed correctly on Android and on the iphone, and clicks on the hyperlink to open http://blog.csdn.net/lyq8479 with a micro-mail built-in browser.
Tip: When testing a micro-credit public account, don't just test it on your phone and think it's all right, because there are several inconsistencies on the Android and iOS platforms on the micro-credit account.