css ID rules



  1.  IDs are best suited for naming parts of your layout so should not give same name for ID and class
  2.  ID allows alphanumeric and special characters  
  3. but avoid using of # : . * ! symbols
  4.  not allowed spaces
  5.  not started with numbers or a hyphen followed by a digit
  6. case sensitive
  7. using ID selectors is faster than using class selectors
  8. use hyphen "-" (underscore "_" can also use but not good for seo) for long CSS class or Id rule names
  9. 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.
  10. In HTML5, the id attribute can be used on any HTML element and In HTML 4.01, the id attribute cannot be used with: , , , , ,

Comments

  1. Only these kind of rules available in CSS???But I knew only few rules in CSS when i was studied CSS and HTML.Now only i learned what are the other rules available in CSS.Thank you for your updates.
    Website Creation Bangalore

    ReplyDelete

Post a Comment

please enter true details, otherwise do not waste your time and our space

Related Posts Plugin for WordPress, Blogger...

Popular Posts

மூக்குத்தி அணிவது ஏன்?

UI Certifications Q & A

Technicals details select

Do's and Don'ts - Central Pollution Control Board (CPCB),

for programmers dropdown

medicals dropdown

:: Useful web links List