- This topic is empty.
-
AuthorPosts
-
May 28, 2012 at 10:01 am #38247Taufik NurrohmanParticipant
I’m in a situation like this: I have been using the
rel
attribute as a kind of data storage and aclass
replacement for the same group element because my blog does not allow attributes other thanrel
andhref
(evendata-*
, especially in the comment form). The problem is that my attributes are not valid for some value (forget about the invalid&
signs. I already know what causes it and it did not matter. As the blog that I use is not an open source platform. I focused on therel
attribute definition only).I don’t quite understand because as I know the definition/function of
rel
attributes is just for a relationship clue that commonly used search engines to help find something and will not affect nothing. But this article and other discussion says that therel
attribute in XHTML only allowed toand
elements.
Is the comment from Chris Pratt in the article can not be a consideration?… As long as you’re correctly identifying a relationship, you should not be constrained by what has or has not been added to some approved list. Take
rel=”lightbox”
for example. This is used all over the web to add lightbox functionality to image galleries …May 28, 2012 at 12:40 pm #103578gilgimechParticipantUsing the rel attribute is kinda a win lose situation. You can use it for stuff like the “lightbox”, but it won’t validate. Not validating isn’t the end of the world though.
WordPress has a rel attribute hard coded in it that doesn’t validate. Does that mean WordPress is wrong? No, it just means it’s not going to have perfect validation.
As long as you don’t care about having your site validate perfectly go ahead and use the rel attribute as you see fit. Just don’t go overboard. Only use it if you need to. Most of the time you can get away with classes and id’s rather than rel.
May 28, 2012 at 10:26 pm #103591Taufik NurrohmanParticipantThanks for the reply. As I could not use a class or ID, so I used
rel
. And I think some of therel
value on my blog is not out of human logic (ex:rel="code"
,rel="pre"
).
I don’t even know if WordPress also has some similar problems. -
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.