Abarim Publications' online Biblical Hebrew Dictionary
It's not quite clear what came first, the verb or the noun, but the verb הבל (habal), means to act emptily or become vain, and the noun הבל (hebel) means vapor, breath, in the negative sense of having no substance and being something very close to nothing.
Both these words are commonly used to denote the worthlessness of idols (Isaiah 57:13) or treasure obtained through deceit (Proverbs 216). It's also the favored word in negative statements regarding general human effort or riches. The famous Ecclesiastes saying, "vanity of vanities; all is vanity," (1:2) uses these same words.
But analyses of this root should always take in account that Abel, the second born human and first victim of violence, bore this root as his name. In Matthew 23:35 Jesus Christ calls Abel righteous, and there aren't many of those, not even in the Bible.