diff --git a/Text/Hamlet/Parse.hs b/Text/Hamlet/Parse.hs
--- a/Text/Hamlet/Parse.hs
+++ b/Text/Hamlet/Parse.hs
@@ -272,7 +272,13 @@
     tagCond = do
         d <- between (char ':') (char ':') parseDeref
         tagClass (Just d) <|> tagAttrib (Just d)
-    tagClass x = char '.' >> (TagClass . (,) x) <$> tagAttribValue NotInQuotes
+    tagClass x = do
+        clazz <- char '.' >> tagAttribValue NotInQuotes
+        let hasHash (ContentRaw s) = any (== '#') s
+            hasHash _ = False
+        if any hasHash clazz
+            then fail $ "Invalid class: " ++ show clazz ++ ". Did you want a space between a class and an ID?"
+            else return (TagClass (x, clazz))
     tagAttrib cond = do
         s <- many1 $ noneOf " \t=\r\n><"
         v <- (char '=' >> Just <$> tagAttribValue NotInQuotesAttr) <|> return Nothing
diff --git a/hamlet.cabal b/hamlet.cabal
--- a/hamlet.cabal
+++ b/hamlet.cabal
@@ -1,5 +1,5 @@
 name:            hamlet
-version:         1.1.3
+version:         1.1.3.1
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
