The <a> (anchor) element creates a hyperlink. Its href is the destination, which can be a URL, a path, an in-page anchor, or a special scheme.
External site
Internal page (relative)
Jump to an element with id="section2"
Send email
Call us
The <a> (anchor) element creates a hyperlink. Its href is the destination, which can be a URL, a path, an in-page anchor, or a special scheme.
External site
Internal page (relative)
Jump to an element with id="section2"
Send email
Call us
<a href="https://other.com" target="_blank" rel="noopener noreferrer">
Opens in a new tab
</a>
target="_blank" ਇੱਕ ਨਵੀਂ ਟੈਬ ਖੋਲਦਾ ਹੈ, ਪਰ ਤੁਹਾਨੂੰ rel="noopener" ਜੋੜਨਾ ਚਾਹੀਦਾ ਹੈ: ਇਸ ਤੋਂ ਬਿਨਾ, ਨਵਾਂ ਪੰਨਾ window.opener ਤਕ ਪਹੁੰਚ ਸਕਦਾ ਹੈ ਅਤੇ ਸੰਭਾਵਤ ਤੌਰ ਤੇ ਤੁਹਾਡੇ ਪੰਨੇ ਨੂੰ ਮੁੜ-ਨਿਰਦੇਸ਼ਿਤ ਕਰ ਸਕਦਾ ਹੈ (ਇੱਕ "tab-nabbing" ਹਮਲਾ)। noreferrer referrer header ਨੂੰ ਵੀ ਹਟਾਉਂਦਾ ਹੈ। ਆਧੁਨਿਕ ਬ੍ਰਾਊਜ਼ਰ _blank ਲਈ noopener ਨੂੰ ਸੰਕੇਤ ਦਿੰਦੇ ਹਨ, ਪਰ ਇਸ ਨੂੰ ਸਪਸ਼ਟ ਰੂਪ ਵਿੱਚ ਜੋੜਨਾ ਸਭ ਤੋਂ ਵਧੀਆ ਅਭਿਆਸ ਹੈ।
<a href="..." rel="nofollow">Don't pass SEO ranking (untrusted/user links)</a>
<a href="..." rel="noopener">Security: no window.opener access</a>
<a href="..." rel="sponsored">Paid/affiliate link</a>
<a href="#top">Back to top</a>
...
<div id="top">...</div> <!-- the link scrolls here -->
ਕਲਿਕ ਕਰਨਾ ਉਸ ਤੱਤ ਤੱਕ ਸਕ੍ਰੌਲ ਕਰਦਾ ਹੈ ਜਿਸਦਾ id fragment ਨਾਲ ਮੇਲ ਖਾਂਦਾ ਹੈ।
Anchors ਵੈੱਬ ਦੀ ਨੇਵੀਗੇਸ਼ਨ ਦੀ ਰੀੜ੍ਹ ਦੀ ਹੱਡੀ ਹੈ।
href schemes (relative, absolute, fragment, mailto/tel), target="_blank" + rel="noopener" ਸੁਰੱਖਿਆ ਜੋੜੀ, ਅਤੇ SEO-ਸੰਬੰਧਿਤ rel ਮੁੱਲ ਨੂੰ ਜਾਣਨਾ ਸਹੀ, ਸੁਰੱਖਿਤ ਲਿੰਕਿੰਗ ਲਈ ਅਪਰਿਹਾਰਜ ਹੈ।