Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Sposób na "Duplicate ID"
Maciek_#_&
post
Post #1





Grupa: Zarejestrowani
Postów: 149
Pomógł: 1
Dołączył: 22.02.2010

Ostrzeżenie: (0%)
-----


Dzień dobry,

Czy jest jakiś sposób żeby dwa te same ID nie tworzyły błędu wg w3c ? jest to mało istotne, ale ciekawi mnie rozwiązanie.
Przykład:
<a href="link" id="emot">Link</a>
Nie tworzy błędu, jednak
<a href="link" id="emot">Link</a>
<a href="link" id="emot">Link</a>
Już tak...

Go to the top of the page
+Quote Post
Damonsson
post
Post #2





Grupa: Zarejestrowani
Postów: 2 355
Pomógł: 533
Dołączył: 15.01.2010
Skąd: Bydgoszcz

Ostrzeżenie: (0%)
-----


Document languages may contain attributes that are declared to be of type ID. What makes attributes of type ID special is that no two such attributes can have the same value; whatever the document language, an ID attribute can be used to uniquely identify its element. In HTML all ID attributes are named "id"; XML applications may name ID attributes differently, but the same restriction applies.

The ID attribute of a document language allows authors to assign an identifier to one element instance in the document tree. CSS ID selectors match an element instance based on its identifier. A CSS ID selector contains a "#" immediately followed by the ID value, which must be an identifier.


http://www.w3.org

Ten post edytował Damonsson 10.10.2010, 17:22:23
Go to the top of the page
+Quote Post
Maciek_#_&
post
Post #3





Grupa: Zarejestrowani
Postów: 149
Pomógł: 1
Dołączył: 22.02.2010

Ostrzeżenie: (0%)
-----


Aha, czyli "class" rozwiąże problem, dzięki (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 5.10.2025 - 19:32