Opaque blocks suffocate you, while transparent blocks do not. Mobs cannot spawn on transparent blocks, nor can they spawn inside opaque blocks. However, they can spawn inside a non-solid transparent block, such as flowers.