Learn about the super connection attribute rel and target of web page standards

Source: Internet
Author: User

The issue of target = "_ blank" has been repeatedly controversial on the internet for many times. Some say they want to stay, some say they want to remove them. The main reason for retaining the claim is that the target = "_ blank" attribute does not have a good solution yet, while the claimant uses the rel and JS solutions. Target = "_ blank" whether it is necessary or not. I think there are still many blind spots. After reading the relevant literature, I found that the actual situation is not what we think. In fact, target = "_ blank" is not against the standard, there is no need to use rel and JS solutions, because this is a misunderstanding. As long as we understand the true meaning of rel and target, we know that there should not be any controversy here. Next, I will share with you the knowledge I have obtained through literature review. Let's first understand the meaning of target and rel:
Target, which allows you to specify the position where the selected hyperlink content is displayed. In other words, the content of the link will be displayed in a window. The target attribute values have four reserved names: _ blank, _ self, _ parent, and _ top.
_ Blank means that the browser always loads the target = "_ blank" link document in a new and untitled window. Here, we may not understand what "Untitled" means. In fact, target is an ID that can be assigned to a new window. For example: target = "name" indicates that the document loaded through the target = "name" link will be displayed in a window named "name. If there is no window with ID "name", the browser will create a window named "name" to display the link document. If the ID of the current window is "name", the link document will replace the original content in the current window.
_ Self refers to the current document. The default goal of <a> is _ self, which is generally unavailable.
_ Parent indicates that the link document is displayed in the parent window. This attribute value is only used in the framework structure. If the base is a top-level framework, it serves the same purpose as _ self.
_ Top is also applied in the framework, but its effect is to clear the framework to display the Target document. This is very useful for switching from a framework structure to a non-framework structure.
Now we know that target is the property of a target that is closely related to the browser. So what is rel? Why do many people regard it as an alternative attribute of target? Next, let's get to know rel. In fact, there is not only one rel, but also a corresponding attribute called rev, which means the relationship between the source document and the target document, and from the Target document to the source document. The source document here can be understood as the current document where the link is located, and the target document is the document to be opened. Now we should know that rel and rev are links to the previous document, rather than how to display the properties of the target document related to the browser.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.