Such a grear article, but some additional info: just to emphasise, within a page an id must be unique.
Most important: ids are automatically created as properties on the global window object.
Good to know, that the ids are linkable, so when you have an id=“here” and you visit your webpage as .com#here, the page will be scrolled to there (if neccessary).
An one personal opinion: using ids make the code hard to maintanable, coming from its behaviour. Because it can be applied to only one element, it can not be reused (nor within a page). Additionally, it has higher precedence than the class merhod, so you have to overwrite the applied rules with !important.
Always use classes, no matter what! :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Such a grear article, but some additional info: just to emphasise, within a page an id must be unique.
Most important: ids are automatically created as properties on the global window object.
Good to know, that the ids are linkable, so when you have an id=“here” and you visit your webpage as .com#here, the page will be scrolled to there (if neccessary).
An one personal opinion: using ids make the code hard to maintanable, coming from its behaviour. Because it can be applied to only one element, it can not be reused (nor within a page). Additionally, it has higher precedence than the class merhod, so you have to overwrite the applied rules with !important.
Always use classes, no matter what! :)