What is the difference between id and class Яка різниця між ідентифікатор і клас
ID tags are very similar to class tag, that's is why many people are confuse. ID мітки дуже схожі на теги клас, ось чому багато людей плутають. I always wonder this myself...here is what I know... Мені завжди було цікаво, це я сам ... І ось що я знаю ...
ID tag can only be use once on a single page. ID тегів може бути тільки один раз використовувати одну сторінку. For example, you have <div id="something">content here</div> you can not use it again on the same page. Наприклад, у вас є <div id="something"> зміст тут </ div> Ви не можете використовувати його знову на тій же сторінці. Actually, you can use the same id tags on the same page as many time as you like because many browsers do not enforce the HTML/XHTML rules but it will give you an error if you validate your page at w3c when you have two identical id tags on the same page. Насправді, ви можете використовувати той же ID мітки на тій же сторінці, як багато часу, як вам подобається, тому що багато браузерів не дотримання HTML / XHTML правил, але він дасть вам помилку, якщо ви активізуєте вашу сторінку в W3C, коли у вас є два однакових ID Мітки на тій же сторінці.
So each id tag must be unique on a single page. Таким чином, кожен ID тег повинен бути унікальним на одній сторінці. Since id are only use once each page, it is very useful to identified a specific content on a page. З ідентифікатором використовувати тільки один раз на сторінку, це дуже корисно, щоб визначити конкретний зміст на сторінці. For example, you have a id for the header and another unique id for the footer and if you want to have the link color for the header to be different from the footer you use id to separate the header and the footer. Наприклад, у вас є ID для заголовка і інший унікальний ідентифікатор для нижньої і якщо ви хочете мати посилання кольору для заголовка, будуть відрізнятися від Footer Ви використовуєте ID відокремити верхній і нижній колонтитули.
It might seem that class are more powerful than id because you can only use id once per page, but that is not true. Може здатися, що клас більш потужні, ніж ID, тому що ви можете використовувати тільки один раз по ID сторінки, але це не так. ID are more powerful than class and it can overwrite the class tags if the style conflict with each other. ID є більш потужними, ніж клас і його можна переписати клас мітки Якщо стиль конфлікт один з одним.
That's all for now. От і все поки. I hope this make sense. Я сподіваюся, що цей сенс зробити. If you don't get it just post comment below and I'll do my best. Якщо ви не отримаєте його просто опублікувати коментар нижче, і я зроблю все можливе.
More info on "What is the difference between id and class" with the below links. Більше інформації на тему "У чому різниця між ідентифікатор і клас" з нижче посилань.
ID tag can only be use once on a single page. ID тегів може бути тільки один раз використовувати одну сторінку. For example, you have <div id="something">content here</div> you can not use it again on the same page. Наприклад, у вас є <div id="something"> зміст тут </ div> Ви не можете використовувати його знову на тій же сторінці. Actually, you can use the same id tags on the same page as many time as you like because many browsers do not enforce the HTML/XHTML rules but it will give you an error if you validate your page at w3c when you have two identical id tags on the same page. Насправді, ви можете використовувати той же ID мітки на тій же сторінці, як багато часу, як вам подобається, тому що багато браузерів не дотримання HTML / XHTML правил, але він дасть вам помилку, якщо ви активізуєте вашу сторінку в W3C, коли у вас є два однакових ID Мітки на тій же сторінці.
So each id tag must be unique on a single page. Таким чином, кожен ID тег повинен бути унікальним на одній сторінці. Since id are only use once each page, it is very useful to identified a specific content on a page. З ідентифікатором використовувати тільки один раз на сторінку, це дуже корисно, щоб визначити конкретний зміст на сторінці. For example, you have a id for the header and another unique id for the footer and if you want to have the link color for the header to be different from the footer you use id to separate the header and the footer. Наприклад, у вас є ID для заголовка і інший унікальний ідентифікатор для нижньої і якщо ви хочете мати посилання кольору для заголовка, будуть відрізнятися від Footer Ви використовуєте ID відокремити верхній і нижній колонтитули.
It might seem that class are more powerful than id because you can only use id once per page, but that is not true. Може здатися, що клас більш потужні, ніж ID, тому що ви можете використовувати тільки один раз по ID сторінки, але це не так. ID are more powerful than class and it can overwrite the class tags if the style conflict with each other. ID є більш потужними, ніж клас і його можна переписати клас мітки Якщо стиль конфлікт один з одним.
That's all for now. От і все поки. I hope this make sense. Я сподіваюся, що цей сенс зробити. If you don't get it just post comment below and I'll do my best. Якщо ви не отримаєте його просто опублікувати коментар нижче, і я зроблю все можливе.
More info on "What is the difference between id and class" with the below links. Більше інформації на тему "У чому різниця між ідентифікатор і клас" з нижче посилань.























