Remember the symbol for class and id in CSS

I always mix up class and id in CSS. “Is class a dot or a hash?” “Is id a period or a pound?” So early on, I came up with a quick brain trick to help me remember which is which.

For id, the symbol is a # (hash or pound depending on your dialect). For this, I think of an id number, as in “My id is #43368″.

For class I think of the word period, and how in school we used to have a break period in the middle of the day for lunch. I imagine all these little dots sitting at their desks, and the bell going off.. end of class.

Leave a comment

You must be logged in to post a comment.