- IDs are best suited for naming parts of your layout so should not give same name for ID and class
- ID allows alphanumeric and special characters
- but avoid using of # : . * ! symbols
- not allowed spaces
- not started with numbers or a hyphen followed by a digit
- case sensitive
- using ID selectors is faster than using class selectors
- use hyphen "-" (underscore "_" can also use but not good for seo) for long CSS class or Id rule names
- If a rule has an ID selector as its key selector, don’t add the tag name to the rule. Since IDs are unique, adding a tag name would slow down the matching process needlessly.
- In HTML5, the id attribute can be used on any HTML element and In HTML 4.01, the id attribute cannot be used with:
, , , , ,
European Union laws - European Union laws require you to give European Union visitors information about cookies used on your blog. In many cases, these laws also require you to ...