What is the difference between div#name and #name? Or is there a difference if you use class or id to position a certain element? Thank you
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You use IDs for elements that appear once in the document. You use classes for more than one elements in the page.
div#name
refers to only that div which has id ‘name’
while #name refers to any element having id ‘name’