CSS doesn't recognize input field?

For some reason, I can’t get CSS to work with my form? I tried almost everything and I can not find the problem? What am I doing wrong?

My HTML structure

<div class="login-container"> <form> <fieldset> <label for="email">Email:</label> <input type="text" name="email" class="input" id="email" /> <br /><br /> <label for="pword">Password:</label> <input type="text" name="pword" id="pword" /> </fieldset> </form> </div> 

My CSS Structure

 .login-container fieldset { padding: 1em; } .login-container label { float:left; width:25%; margin-right:0.5em; padding-top:0.2em; text-align:right; font-weight:bold; } .input { background-color:#F00; } 
+4
source share
2 answers

Remove. in front of your input selector.

 input { background-color:#F00; } 

See also: CSS element selector vs CSS.class selector

+2
source

Everything seems to work fine, see jsfiddle.net/4FCgc/

What does not work? Perhaps this is your web browser cache ... But I doubt it.

0
source

All Articles