Humor is allowed, but dangerous. The problem with humor that it is very subjective, and difficult to use effectively.
Is your message actually funny? You may think that depends on you, but it actually depends much more on your readers. If your audience doesn't "get" your humor, then your posts may seem unprofessional, off-topic or even offensive.
Using humor on Stack Exchange sites is harder than using humor in "normal" life. SE reaches a worldwide audience, and humor does not translate well across cultural boundaries. SE also depends entirely on written communication, so there is no way to use tone, inflection, timing or other verbal cues that frequently indicate humor.
In short, the chance that humor will cause problems is much greater than the chance that it will generate a positive response, unless you have a very firm grasp on the overall personality of your audience.