What's your opinion on giving girls a compliment that you've never spoken to before.

There is this girl that I've had a class with her (99% sure she doesn't know who I am because there was 100 ppl in the class) and she's above average attractiveness. She's usually alone, and to me she's very attractive. I've read that usually you don't want to give sort of a superficial compliment, but I feel inclined to just tell her when I see her in the hall, "hey what yours name? Just wanted to say you're absolutely beautiful."

Don't really want anything else. Have any of you done something like this?