tags:

views:

60

answers:

2

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

<a href="#" rel="value1 nofollow">Link</a>

.. is it valid and cross-browser compatible?

+2  A: 

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

Zach Hirsch
+1, but I wouldn't make assumptions in web design - especially regarding browser support...
Moshe
+1  A: 

Definitely valid.

You can also do the same thing with the class attribute and the id 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.

Moshe