Liquid Fire Posted January 7, 2007 Share Posted January 7, 2007 here is my html and css code:html:[code]<table> <form id="login_form" method="post" action="login.php"> <tr><td align="right">User Name:</td><td><input class="light" type="light" name="user_name" /></td></tr> <tr><td align="right">Password:</td><td><input class="light" type="light" name="password" /></td></tr> <tr><td colspan="2" align="center"><input type="submit" name="submit" value="Login" /></td></tr> </form></table>[/code]css[code]#login_form .light{ background-color: #CCCCCC; }[/code]Now my css is not the greatest but should this make the input box background color be light grey? if i have this as my css code it works fine:[code].light{ background-color: #CCCCCC; }[/code]the code works fine but i might not want all things with class="light" to have the background. what is wrong with the first CSS code? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted January 7, 2007 Share Posted January 7, 2007 The form should be wrapped around the table. Not the table wrapped around the form.Your HTML is the error. It should be like this:[code]<form id="login_form" method="post" action="login.php"> <table> <tr><td align="right">User Name:</td><td><input class="light" type="text" name="user_name" /></td></tr> <tr><td align="right">Password:</td><td><input class="light" type="password" name="password" /></td></tr> <tr><td colspan="2" align="center"><input type="submit" name="submit" value="Login" /></td></tr> </table></form>[/code]Also you was using an invalid input type of light. So I change the input fields to text and password for the username and password fields. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.