![]() |
|
||||||||||
|
|||||
|
Какие правила установки имён классов и для id в цсс?
|
|
|||||
|
я имею ввиду какие символы.
можно ли использовать минус, к примеру. или одни цифры |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Я думаю, надо спеку читать просто.
|
|
|||||
|
там не написано, я просматривал
|
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Это не врите.
http://www.w3.org/TR/CSS1#forward-compatible-parsing «in CSS1, selectors (element names, classes and IDs) can contain only the characters A-Z, 0-9, and Unicode characters 161-255, plus dash (-); they cannot start with a dash or a digit; they can also contain escaped characters and any Unicode character as a numeric code (see next item).» http://www.w3.org/TR/CSS21/syndata.html#q6 «In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-z0-9] and ISO 10646 characters U+00A1 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F".» |
|
|||||
|
оо. Спасибо!
меня как раз интерисует "they cannot start with a digit, or a hyphen followed by a digit" не может начинать с цифры, или с дефиса следующего за цифрой. помоему условие первой части предложения включает в себя условие второй части. Или как тут правильно перевести? |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Скорее наоборот, не может быть дефис, а потом цифра. «followed by» — это значит, что цифра следует за дефисом.
|
|
|||||
|
Саписибо большое.
![]() |
![]() |
![]() |
Часовой пояс GMT +4, время: 06:41. |
|
|
« Предыдущая тема | Следующая тема » |
|
|