On 02/07/2010 13:09, designer wrote:
In a recent "links for light reading"  reference was made to a very
interesting article by Chris Coyier on attribute selectors such as 'rel'.

http://css-tricks.com/attribute-selectors/

At the very basic level, the article exemplifies
h1[rel="external"]{color : red;} used with the html:

<h1 rel="external">Attribute Equals</h1>

I tried this, and several other really useful examples, but later found
that the validator doesn't like it/them, saying:

there is no attribute "rel"
You have used the attribute named above in your document, but the
document type you are using does not support that attribute for this
element. This error is often caused by incorrect use of the "Strict"
document type with a document that uses frames (e.g. you must use the
"Transitional" document type to get the "target" attribute), or by using
vendor proprietary extensions such as "marginheight" (this is usually
fixed by using CSS to achieve the desired effect instead).

Do we just ignore this? I always thought of 'rel' being used with links,
but on playing about I find that <div rel="whatever"> works fine too.

I think the example used in that article is quite unfortunate and a bit removed from real world use...why would you have a rel on the h1 or div? Makes no sense semantically, and seemed a very stilted bit of code just so he could then show the example with attribute selectors.

I'd say no, don't ignore it. Stick with valid markup. In the case of the h1 there it seems far more logical to use a class name...just because you can now do attribute selectors, doesn't mean that the old tried techniques are not valid.

P
--
Patrick H. Lauke
______________________________________________________________
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]

www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com | http://flickr.com/photos/redux/
______________________________________________________________
twitter: @patrick_h_lauke | skype: patrick_h_lauke
______________________________________________________________


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [email protected]
*******************************************************************

Reply via email to