Multiple values for rel attribute

后端 未结 6 1937
攒了一身酷
攒了一身酷 2021-01-01 08:55

Can I have multiple values for rel attributes? Like so:

Link

.. is it valid and cross

相关标签:
6条回答
  • 2021-01-01 09:04

    Definitely valid.

    You can also do the same thing with the class attribute. This is handy for CSS styling.

    HTML:

    <span class="foo bar more classes">Stuff</span>
    <span class="bar">More bar</span>
    

    CSS

    .foo{
      color: #afafaf;
    }
    
    .bar{
      border: 1px solid #0ff;
    }
    

    The first span would be gray and have the blue border, while the second span would just have the border.

    0 讨论(0)
  • 2021-01-01 09:13

    Yes it's valid and it works on all browsers, including IE7 and IE8

    0 讨论(0)
  • 2021-01-01 09:22

    Actually it isn't valid according to Structured Data Testing Tool.

    I tried this tonight, using the following

    rel="publisher nofollow"
    

    and it failed to validate the publisher. As soon as I removed the nofollow is validated ok again.

    I thought I would post my answer, as I came across this thread after doing a Google search for the same question.

    0 讨论(0)
  • 2021-01-01 09:24

    It's valid. I'm not sure if it's supported by all browsers, though, but I would guess that it is.

    rel = link-types [CI] This attribute describes the relationship from the current document to the anchor specified by the href attribute. The value of this attribute is a space-separated list of link types.

    0 讨论(0)
  • 2021-01-01 09:27

    yes you can and it's valid: e.g: rel='tag nofollow'

    <a expr:href='data:label.url' rel='tag nofollow'><data:label.name/></a>
    

    just use values with giving "blank space" among them. The complete details of tags used inside rel are here..

    http://www.w3schools.com/tags/att_a_rel.asp

    0 讨论(0)
  • 2021-01-01 09:28

    I tried this with jQuery Mobile and it doesn't work. It works if I remove the second attribute.

    rel="external nofollow"
    
    0 讨论(0)
提交回复
热议问题