In the previous article "Teach you step by step how to use the img tag to add image effects (knowledge)", I introduced you how to use the img tag to add image effects. The following article will show you how to create an click link. Newbies, please take a look.
# Tag: It is a hyperlink tag in HTML, usually starting with " " appears in pairs.
href attribute: Specify the link address and specify the text to be displayed inside the element.
<a href="//m.sbmmt.com">php中文网</a>
Not only can it contain text, You can also include other elements, such as <h1>
The code example is as follows
<a href="//m.sbmmt.com"> <h1>我是PHP中文</h1> </a>
The code rendering is as follows
Can contain pictures (the previous article has detailed description of picture elements).
The code example is as follows
<a href="//m.sbmmt.com"> <img src="https://img.php.cn/upload/image/682/458/838/1627535900680707.jpg" style="max-width:90%" style="max-width:90%" alt="Beginner's article: How to use the <a> tag to create a link (share)" > </a>
The code rendering is as follows
tag to create a link (share)" > tag to create a link (share)" title="162763474027335Beginners article: How to use the tag to create a link (share)" alt="Beginners article: How to use the tag to create a link (share)"/>Click any of the links above and you will find that the new page will be on the current page Open, the current page will be overwritten. Sometimes we don't want the current page to be overwritten. Can we let it open in a new tab?
No problem, we can use the target attribute to specify the click jump method.
target attribute: There are a total of the following values, of which the first two are the most commonly used
: In new Open in window;
: Default. Open in the same frame;
: Open in the parent frame set;
: Open in the entire window.