Can I have multiple values for rel attributes? Like so:
<a href="#" rel="value1 nofollow">Link</a>
.. is it valid and cross-browser compatible?
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.
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.
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..
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.
I tried this with jQuery Mobile and it doesn't work. It works if I remove the second attribute.
rel="external nofollow"