search

Home  >  Q&A  >  body text

HTML attributes

What is the difference between "id" and "class"?

博文博文1596 days ago1159

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2020-07-17 19:42:05

    id is the unique element identifier of the page, and class is the identifier of the first-class element of the page.

    But the uniqueness of the id requires the developer to ensure it, and the browser does not check it

    reply
    0
  • Cancelreply