Link rel vs. Target differences _ Experience Exchange

Source: Internet
Author: User
Target= whether the existence of "_blank" is necessary I think a lot of them are in a blind spot at present. I consulted the relevant literature, found that the situation is not what we think, in fact target= "_blank" is not a non-standard, and with the Rel and JS solution is not necessary, because this is a misunderstanding, As long as we understand the true meaning of rel and target, we know that there should be no controversy here. I'll share with you what I've learned by looking at the literature, so let's look at the meaning of target and rel:

Target, which allows you to specify where to display the content of the hyperlink that has been selected. This means that the linked content will be displayed in what window. The property value of target has four reserved names, respectively: _blank,_self,_parent,_top. The _blank means that the browser always loads the target= "_blank" linked document in a newly opened, unnamed window. People here may not understand what "unnamed" means. In fact, Target can assign an ID to the newly opened window, for example: target= "Name" which indicates that the document loaded via the target= "name" link will be displayed in a window called "name". If there is no window with ID "name", then the browser will create a new window named "Name" to display the linked document. If the ID of the current window is "name" then the linked document will be displayed in the current window instead of the original content. And _self's meaning is actually the current document, the default goal is _self, this attribute value is generally not used. _parent is to make the linked document appear in the parent window, this property value is used only in the frame structure, if the body is a top-level frame, then its role is the same as _self. _top is also applied to the frame, but his effect is to clear the frame to display the target document. This is useful for moving from a frame structure to a frame-free structure.

Now we know that target is a destination. The properties displayed are closely related to the browser. So what is rel, and why are many people treating him as an alternative to target? Let's get to know rel. In fact, there is not only one rel there is also a corresponding property called Rev, which means the relationship from the source document to the target document, the relationship from the target document to the source document. The source document here can be understood as the current document in which the link is located, and the target document is the document that the link will open. So we should be clear, actually. Rel and Rev are a link to a document, not a browser-related way to display the properties of the target document.

So what is the relationship between Rel and Rev? The following one by one columns take and explain the meaning:

Next, link to the next document;
Prev, linking to the previous document;
Head, linked to the top-level document in the collection;
TOC, a directory linked to a collection;
Parent, linked to the document above the source;
Child, linked to the document below the source;
Index, which is linked to the indexing of this document;
Glossary, linked to the glossary of this document;

Where next is a group with prev. Indicates that the relationship between the current document and the target document is sibling, which can be written as such. Head and TOC can form a combination of a directory that is linked to the final document, or linked to a directory by the document. The parent and child are a group of documents that are linked by the current document to the parent document or to the children document. The index and glossary can be combined with the head, either from the document to the index or from the index to the document, to the glossary or to the glossary to the document.

Perhaps this is not very clear, the following example: I have organized a film document resources, then I need to classify these resources, I divided the film: Martial arts, war, Love, horror, documentary. Then I am in the movie root directory need to link to the following subclass when the link should be: Rel=child rev=parent, and if the current is a martial arts film channel page, I need to switch to love channel or other channels, then the link relationship should be: Rel=next rev= Prev, when we from a martial arts film linked to the "Crouching Tiger Hidden Dragon" The film's document link should be: Rel=head Rev=toc, when the "Crouching Tiger Hidden Dragon" link to the index when the link relationship has become: Rel=index rev=head.

Since the current CSS does not capture the value of the Rel and Rev properties, there is no way to provide different styles for links to different relationships, so now rel and Rev are only used to make the semantics of the Web page more perfect.
  • Related Article

    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.