If you're doing an interview over the phone or in some other context where the interviewer can't see what you're doing, you should NOT just look things up on the internet without first asking if it's ok. That is cheating in every interview I have given. It's unethical, and you really don't want to start off a job having tricked your peers into thinking you know more off the top of your head than you actually do.
Testing what people know off the top of their head and testing how well people can look things up on the internet are both legitimate things to test in an interview setting, and I've done both types of interviews. One big downside to letting people use the internet is that it tends to slow down the interview significantly and it adds variability unrelated to the skill of the candidate (e.g. maybe you got unlucky in your search terms and found an unrelated/unhelpful result that took up a bunch of time). In many cases, it's better to get a sense of which concepts the candidate is already comfortable and experienced with, which isn't something that should require the internet. (I tend to avoid tests of knowledge in the first place, but I think they make plenty of sense when hiring for a specialized role.)
It's also naive to think that (for example) someone who hasn't heard of CSS specificity could be just as productive solving a specificity-related CSS issue than someone who has solved a bunch of specificity-related problems in the past, as long as both of them have access to Stack Overflow.