Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Philippe Wittenbergh

On Mar 31, 2011, at 11:49 PM, Alan Gresley wrote:

>  Updated test case.
> 
> 

fwiw, when validating the stylesheet, I get the following 2 errors:
.\3 Value Error : background #\0030\0066\0030 is not a valid color 3 or 
6 hexadecimals numbers #\0030\0066\0030
div Value Error : border Unknown dimension 10\0070\x

Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Alan Gresley

Short answer to this one.

On 1/04/2011 2:14 AM, Barney Carroll wrote:





Is the update for the generated content tests?



Did you not the 2nd, 3rd and 4th test. If an ID was like this 
'id=""' the following would all work.


.\31\31\31\31 { ... }

.\031\031\031\031 { ... }

.\0031\0031\0031\0031 { ... }



Removing the escape
characters will reveal the digit content… But I'm not sure what's
being tested for. Interestingly, Webkit's DOM inspector shows the
processed rule for span.one::before as being

content: 'url(0');

No idea what that's about.



Browsers show difference with encoding. Strange what Safari shows. Is 
this in Firebug? My Firebug does not work. I think I need I clean 
install of Safari sine I have other problems with it.


This is a error that the CSS validator has.




13 Parse Error Lexical error at line 1, column 1. Encountered: "\u0a0a" 
(2570), after : ""



This I will explain in the other email (about the parsing, not the 
validator error).




I'm not saying there necessarily isn't a good reason… But I don't know
what that reason is. Thanks for the continued testing and
investigation.



It's coming. :-)


--
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Barney Carroll
On 31 March 2011 15:49, Alan Gresley  wrote:
>> If you're dealing with a web app that procedurally generates
>> identifiers beginning with digits and you have to support IE6-7,
>> you've probably got bigger things to worry about ;)
>
>
> Are you sure.

Not really — it's a hypothetical situation, and I was making an awful
attempt at humour. I acknowledge that in practice if that situation
arose and you had to use these identifiers to style elements in IE,
the encoded characters method you've shown would work.

> Updated test case.
>
> 

Is the update for the generated content tests? Removing the escape
characters will reveal the digit content… But I'm not sure what's
being tested for. Interestingly, Webkit's DOM inspector shows the
processed rule for span.one::before as being

content: 'url(0');

No idea what that's about.


> IE6 and IE7 supports this as well as all other modern browsers except for
> IE5.5 which sees nothing and WebKit that shows no blue border. I not sure
> how older versions of Gecko, Presto or WebKit would handle the test case.
>
> There is good reason for all this Barney. I'm attempting to answer your
> earlier email as I write this one to explain why this is so.

I'm not saying there necessarily isn't a good reason… But I don't know
what that reason is. Thanks for the continued testing and
investigation.


Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Alan Gresley

On 1/04/2011 12:31 AM, Barney Carroll wrote:

On 31 March 2011 13:49, Markus Ernst  wrote:

I could imagine a hypothetic Web application that generates class names from
any other information, which may start with a digit. Thus class names may
not even be known at coding time. In that case, escaping all digits might be
a valuable alternative.


In that situation I would be more eager to use [class~=1] selectors —
at least they are human readable and reproducible without any external
methods.

If you're dealing with a web app that procedurally generates
identifiers beginning with digits and you have to support IE6-7,
you've probably got bigger things to worry about ;)



Are you sure. Updated test case.




IE6 and IE7 supports this as well as all other modern browsers except 
for IE5.5 which sees nothing and WebKit that shows no blue border. I not 
sure how older versions of Gecko, Presto or WebKit would handle the test 
case.


There is good reason for all this Barney. I'm attempting to answer your 
earlier email as I write this one to explain why this is so.


Thank you Philippe for making me aware of the differences in HTML4.0.1 
and HTML5. I didn't realizes that a ID or NAME was not allowed to begin 
with a digit in HTML4.0.1.



--
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Barney Carroll
On 31 March 2011 13:49, Markus Ernst  wrote:
> I could imagine a hypothetic Web application that generates class names from
> any other information, which may start with a digit. Thus class names may
> not even be known at coding time. In that case, escaping all digits might be
> a valuable alternative.

In that situation I would be more eager to use [class~=1] selectors —
at least they are human readable and reproducible without any external
methods.

If you're dealing with a web app that procedurally generates
identifiers beginning with digits and you have to support IE6-7,
you've probably got bigger things to worry about ;)


On 31 March 2011 14:07, Philippe Wittenbergh  wrote:
> On Mar 31, 2011, at 8:12 PM, Barney Carroll wrote:
>> A simpler question, that has still yet to be answered, is why
>> digit-led class or id identifiers are banned in the first place. Alan,
>> Phil — any ideas?
>
> HTML 4 has / had this:
> http://www.w3.org/TR/html401/types.html#type-name
> (linked from
> http://www.w3.org/TR/html401/struct/global.html#adef-id )
>
> Class is looser
> http://www.w3.org/TR/html401/types.html#type-cdata
>
> HTML5 doesn't seem to impose limits, afaict
> http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#the-id-attribute

Thanks for the research Phil. So this is a hangover from HTML4 spec
(which is hardly self-explanatory of itself). To be perfectly honest,
the times where I've initially actually wanted to use leading digits
as identifying strings, it's semantics rather than the practical
limitation that have made me reconsider — numbers unqualified by
descriptors can lead to all sorts of nonsense.


Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Philippe Wittenbergh

On Mar 31, 2011, at 8:12 PM, Barney Carroll wrote:

> A simpler question, that has still yet to be answered, is why
> digit-led class or id identifiers are banned in the first place. Alan,
> Phil — any ideas?

HTML 4 has / had this:
http://www.w3.org/TR/html401/types.html#type-name
(linked from
http://www.w3.org/TR/html401/struct/global.html#adef-id )

Class is looser
http://www.w3.org/TR/html401/types.html#type-cdata

HTML5 doesn't seem to impose limits, afaict
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#the-id-attribute

Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Philip Taylor (Webmaster, Ret'd)



Markus Ernst wrote:


I could imagine a hypothetic Web application that generates class names
from any other information, which may start with a digit. Thus class
names may not even be known at coding time. In that case, escaping all
digits might be a valuable alternative.


Far simpler would be to add an explicit prefix
selected from the nmstart set ([_a-z]|{nonascii}|{escape}).

Yes, by all means escape what follows, but don't
blindly start an identifier with some arbitrary
escape sequence.

Philip Taylor
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Markus Ernst

Am 31.03.2011 13:12 schrieb Barney Carroll:


But even from that angle, can this be considered good practice? Isn't
it contrary to the specification's intentions in forbidding digit-led
identifiers using the standard methods? Would you genuinely suggest
this advice to the OP, or is this purely an exercise in exploiting
spec loopholes?


I could imagine a hypothetic Web application that generates class names 
from any other information, which may start with a digit. Thus class 
names may not even be known at coding time. In that case, escaping all 
digits might be a valuable alternative.



A simpler question, that has still yet to be answered, is why
digit-led class or id identifiers are banned in the first place. Alan,
Phil — any ideas?


Interesting question I was wondering about since I learnt CSS.
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Barney Carroll
On 31 March 2011 11:38, Philip Taylor (Webmaster, Ret'd)
 wrote:
> The specification says "they cannot start with a digit"; Alan says
> "they can start with numbers"; the question is therefore "are there
> numbers that are not digits", and Alan is arguing "yes, if the
> number is encoded using a character escape" (e.g., \31 to represent
> the digit/number "1").

Thanks for translating, this stuff needs patience and interpretive skills! ;)

Isn't this a hack in some sense? As you've pointed out, starting with
a digit is contra-spec. Alan is saying an identifier starting with a
digit can be used, but one has to express it in such a way that, in
its explicit written form, it does not appear as a digit, and one way
of doing that is by expressing the number under a different,
non-digital encoding (only in the CSS — using the same string in the
HTML wouldn't work).

It's not at all obvious, and it employs a counter-intuitive writing
method for the express purpose of evading constrictions expressed in
other parts of the spec.

A more intuitive and certainly more readable method (but less
widely-supported — although at this point I am purely academically
interested in W3 errata, since both methods are non-standard and
confusing unless the viewer has express knowledge of it) would be to
express the selector via the attribute selection pattern:

[class~=1]

Again, as far as I'm concerned, this is all academic. I work on large
projects that must be able to be maintained by people with generic
industry standard working knowledge, so I wouldn't allow this in at
the risk of confusing colleagues & successors.

But even from that angle, can this be considered good practice? Isn't
it contrary to the specification's intentions in forbidding digit-led
identifiers using the standard methods? Would you genuinely suggest
this advice to the OP, or is this purely an exercise in exploiting
spec loopholes?

A simpler question, that has still yet to be answered, is why
digit-led class or id identifiers are banned in the first place. Alan,
Phil — any ideas?



Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Philip Taylor (Webmaster, Ret'd)



Philip Taylor (Webmaster, Ret'd) wrote:

> It will take me some time to decide by looking at the formal
> parts of the specification whether Alan is correct in his assertion;
> perhaps others more familiar with the formal syntax can save
> time by answering and/or pointing us at the rule(s) involved.

It is not necessary.  On the assumption that the informative
notes do not contradict the normative grammar, Alan's
assertion is confirmed :

> Note: ... "\32" is allowed at the start of
> a class name, even though "2" is not.

Philip Taylor


__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Philip Taylor (Webmaster, Ret'd)



Alan Gresley wrote:


The answer is no. Isn't the css2.1 spec clear enough ?




This is not correct. You can begin ID and class selectors with numbers.
The only thing is that they must be encoded properly with characters
escapes (the above spec gives details).




The specification says "they cannot start with a digit"; Alan says
"they can start with numbers"; the question is therefore "are there
numbers that are not digits", and Alan is arguing "yes, if the
number is encoded using a character escape" (e.g., \31 to represent
the digit/number "1").

It will take me some time to decide by looking at the formal
parts of the specification whether Alan is correct in his assertion;
perhaps others more familiar with the formal syntax can save
time by answering and/or pointing us at the rule(s) involved.

Philip Taylor
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Barney Carroll
On 31 March 2011 11:21, Alan Gresley  wrote:
> This is not correct. You can begin ID and class selectors with numbers. The
> only thing is that they must be encoded properly with characters escapes
> (the above spec gives details).

Very cunning stuff!


>> On Mar 31, 2011, at 12:09 AM, Elli Vizcaino wrote:
>> Isn't the css2.1 spec clear enough ?

If this thread has proved anything, it's that the spec really isn't
clear enough.

Alan, do you understand the logic behind the notion that numbers
should be escaped, or that the proper encoding would be anything other
than their natural state? I see what's happening, I just don't see why
it's happening…


Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-31 Thread Alan Gresley

On 31/03/2011 2:01 PM, Philippe Wittenbergh wrote:


On Mar 31, 2011, at 12:09 AM, Elli Vizcaino wrote:


So I guess, in essence the answer is NO you cannot begin a class or
ID name with numeric characters?


The answer is no. Isn't the css2.1 spec clear enough ?




This is not correct. You can begin ID and class selectors with numbers. 
The only thing is that they must be encoded properly with characters 
escapes (the above spec gives details).





It would be very wise for every one to study the source code showing CSS 
and HTML. IE9, FF3.6.16 and Opera 11 parses this correctly. WebKit fails 
with the blue border.


This is the CSS.


#\31\31\31\31 { background: lime }

  equals   # { background: lime }


.\32\32\32\32 { background: #\0030\0066\0030  }

  equals  . { background: lime }


.\06B0 { background: lime }

  equals  .ڰ { background: lime }


\0064\0069\0076 { bac\k\g\r\o\u\nd: lime; border: 10\0070\x solid 
\0062\006C\0075\0065 }


  equals   div { background: lime; border: 10px solid blue }


Character escapes play an impotent role is CSS tokenization (I'm still 
learning).






--
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Philippe Wittenbergh

On Mar 31, 2011, at 12:09 AM, Elli Vizcaino wrote:

> So I guess, in essence the answer is NO you cannot begin a class or ID name 
> with numeric characters?

The answer is no. Isn't the css2.1 spec clear enough ?


> http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names#answer-449000

That discussion thread is absolute confusing, and mixing rules for property 
names with rules for class and id names.



Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Elli Vizcaino
Thanks Barney! Your test case and previous response was most helpful. I will 
stick with the practical advice that NO it is not a good idea to start names of 
classes/IDs with numeric characters or dashes. 

Thanks for your help!
Elli 


--- On Wed, 3/30/11, Barney Carroll  wrote:


> A test case for a variety of
> selectors up here:
> http://barneycarroll.com/validCSSselectors.html
> 
> Ones in green work, ones in red don't.
> 
> On 30 March 2011 16:39, Philip Taylor (Webmaster, Ret'd)
> 
> wrote:
> >Only if you believe in anarchy, surely ?
> 
...Ultimately, I believe posters come here for practical advice. 
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Philip Taylor (Webmaster, Ret'd)



Barney Carroll wrote:


The line between philosophy&  politics blurs! If it works, I'll do it.
If it doesn't I won't. The question is ideological and we could debate
it for yonks. Ultimately, I believe posters come here for practical
advice. If they were looking for the spec, a bot could do a better job
than the lot of us.


OK, one last attempt and then I'll shut up.  What is "practical advice" ?
Is it (for example) "This will work in all browsers currently known to
man, but violates one or more W3C specifications" ?  If so, then how
can you (as the person offering the advice) have any confidence that
it will also work in next year's browser, or next week's, or even
tomorrow's ?  If, on the other hand, the practical advice were
"This will work in all browsers currently known to man, and is
fully compliant with all relevant W3C specifications", then would
not you (as the author) and I (as the consumer) have justifiable
confidence that it will continue to work in future browsers for
some considerable time to come ?

Over and out.
** Phil.
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Barney Carroll
A test case for a variety of selectors up here:
http://barneycarroll.com/validCSSselectors.html

Ones in green work, ones in red don't.

On 30 March 2011 16:39, Philip Taylor (Webmaster, Ret'd)
 wrote:
>Only if you believe in anarchy, surely ?

The line between philosophy & politics blurs! If it works, I'll do it.
If it doesn't I won't. The question is ideological and we could debate
it for yonks. Ultimately, I believe posters come here for practical
advice. If they were looking for the spec, a bot could do a better job
than the lot of us.

On 30 March 2011 16:39, Philip Taylor (Webmaster, Ret'd)
 wrote:
>in order to pander to the inability
>of browser vendors to W3C specifications

Browser vendors v W3C is a Gordian knot. Alexander's sword is the
user. If they're happy, so am I (and the clients, etc).


Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Philip Taylor (Webmaster, Ret'd)



Barney Carroll wrote:


Popularity can be a fallacious indicator, but so can authority over
the specification. Practice is the only sure indicator.


Only if you believe in anarchy, surely ?


Following W3 spec to the letter is fairly limiting, since in practice browser
implementations differ (from the specification and from each-other).
Forgotten about IE6 already? ;)


No, but neither have I ever found it necessary to generate
a non-conformant document in order to cope with its vagaries
(or even with the vagaries of Netscape 4).

Surely the goal is to write fully conformant documents that
render reliably (if not necessarily consistently) in all
mainstream browsers; if the alternative is to write non-
conformant documents in order to pander to the inability
of browser vendors to W3C specifications, then count me
out, please.

Philip Taylor
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Barney Carroll
On 30 March 2011 16:20, Lesley Lutomski  wrote:
> On 30/03/11 16:09, Elli Vizcaino wrote:
>>
>> So I guess, in essence the answer is NO you cannot begin a class or ID
>> name with numeric characters?
>
> Trip Adviser do it all the time and the W3 Validator throws an error, so
> technically I guess you can but you shouldn't!

Clarification: markup will render fine with any ID or class attribute.
CSS rules using ID or classnames beginning with numbers, or a double
hyphen, will not be applied. This is a CSS parsing issue, not a markup
or script one.


On 30 March 2011 16:08, Philip Taylor (Webmaster, Ret'd)
 wrote:
> Very succinctly ?  By the end of reading it, I was more confused
> than when I started !  It even starts with a glaring error :
>
>> a name must start with an underscore (_), a dash (-), or a letter(a–z),
>> followed immediately 1 by a letter or underscore

You're right. The expression underneath that statement the link above
it are correct and succinct.


On 30 March 2011 16:08, Philip Taylor (Webmaster, Ret'd)
 wrote:
> the validator says "All is well"; I would trust the validator over
> Stackoverflow any day !

Popularity can be a fallacious indicator, but so can authority over
the specification. Practice is the only sure indicator. Following W3
spec to the letter is fairly limiting, since in practice browser
implementations differ (from the specification and from each-other).
Forgotten about IE6 already? ;)



Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Lesley Lutomski

On 30/03/11 16:09, Elli Vizcaino wrote:

So I guess, in essence the answer is NO you cannot begin a class or ID name 
with numeric characters?


Trip Adviser do it all the time and the W3 Validator throws an error, so 
technically I guess you can but you shouldn't!


Lesley
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Elli Vizcaino
Yes I saw that before I sent my question out to the list. I got a little 
confused by the link to the CSS Grammer. And some of the noations in on of the 
comment replies: 

"Identifiers beginning with a dash or underscore are typically reserved for 
browser-specific extensions, as in -moz-opacity."

"1. Note that, according to the grammar I linked, a rule starting with TWO 
dashes, e.g. --indent1, is invalid. However, I'm pretty sure I've seen this in 
practice."

"2. It's all made a bit more complicated by the inclusion of escaped unicode 
characters (that no one really uses)."

So I guess, in essence the answer is NO you cannot begin a class or ID name 
with numeric characters?

Elli 


--- On Wed, 3/30/11, Barney Carroll  wrote:

> Hiya Elli,
 
> This question was answered very succinctly on
> stackoverflow:
> 
> http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names#answer-449000
> 
> Hope this helps,
> 
> 
> Regards,
> Barney Carroll
> 

> 07594 506 381

__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Philip Taylor (Webmaster, Ret'd)



Barney Carroll wrote:

Hiya Elli,

On 30 March 2011 15:49, Elli Vizcaino  wrote:

I forget what the rules are for naming classes and IDs


This question was answered very succinctly on stackoverflow:

http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names#answer-449000

Hope this helps,


Very succinctly ?  By the end of reading it, I was more confused
than when I started !  It even starts with a glaring error :


a name must start with an underscore (_), a dash (-), or a letter(a–z), 
followed immediately 1 by a letter or underscore


which would rule out  (leading
letter NOT followed by letter or underscore).

However, pointing validator.w3.org at

http://web-consultants.org.uk/sites/tests/A1.css

which contains

.A1 {visibility : inherit}

the validator says "All is well"; I would trust the validator over
Stackoverflow any day !

Philip Taylor
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread David Postill
On Wed, 30 Mar 2011 07:49:39 -0700 (PDT), Elli Vizcaino wrote:

| Hello CSS Discuss,
| 
| I forget what the rules are for naming classes and IDs. I know you can use 
numbers but you can't start a class/ID name with one, correct? Can someone 
please confirm and hopefully shed more light on the correct naming convention 
to use.
| 

http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names
-- 
David Postill
Dance your Life - Biodanza in Holland - 
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Rule of Thumb For Naming Classes/IDs?

2011-03-30 Thread Barney Carroll
Hiya Elli,

On 30 March 2011 15:49, Elli Vizcaino  wrote:
> I forget what the rules are for naming classes and IDs

This question was answered very succinctly on stackoverflow:

http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-names#answer-449000

Hope this helps,


Regards,
Barney Carroll

barney.carr...@gmail.com
07594 506 381
__
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/