Back to Browse

Control Links With the HTML Target Attribute

2.4K views
Feb 27, 2021
14:58

► In this video, we are going to talk about the target attribute which allows us to control how we open the links on our webpages. Using the value of _blank tells the browser to open the link in a new tab (or window on older browsers) when the link is clicked. This the only value used with the target attribute today. We will also discuss security concerns when linking to external sites and how we can overcome these by adding the rel attribute with the values of noopener and noreferrer. The last thing we will look at is the base element which allows us to set specific rules for all of the links in our HTML document. ► Timestamps: 0:00 Start 1:30 The target attribute 1:57 Historical values of the target attribute 2:25 Deprecated HTML frames 3:37 Example of a frameset 5:24 Using different target values in frames 6:01 The _blank attribute 7:05 Operating links with keyboard shortcuts 8:38 The rel attribute 9:19 noopener and noreferrer 10:14 The base element 11:25 Setting the base element 12:30 Overriding the base 13:20 Summary ► Get the code: Repo: https://github.com/craigabourne/html-target-frames-base ► Links used in the video: MDN anchor element attributes (scroll down for target & rel): https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes Frames: https://html.com/frames/ HTML 4.01 frameset doctype: https://www.w3schools.com/tags/tag_doctype.asp Rel attribute: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes Noopener & noreferrer: https://developers.google.com/web/tools/lighthouse/audits/noopener The base element: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base ► The HTML for Absolute Beginners Playlist: https://www.youtube.com/playlist?list=PL4cTxE4s2XIYJL6uPQUwMt25M70gPl-O6 ► Social Media: https://www.twitter.com/craigabourne https://www.instagram.com/craigabourne ► Code & Projects: https://github.com/craigabourne https://codepen.io/craigabourne

Download

0 formats

No download links available.

Control Links With the HTML Target Attribute | NatokHD