kirbyweb Posted November 6, 2009 Share Posted November 6, 2009 OK I have created a bunch of stuff on my website, but out of all things, I am stuck at how to change the text color in a form.I know this is a noob question but can anyone help?Here is my code: <form action='______' method='POST'>Username: <input type='text' name='username'><br>Password: <input type='password' name='password'><br><input type='submit' value='Log in'></form> <p><a href='register.php'>Register?</a> Thanks. Link to comment Share on other sites More sharing options...
ShadowMage Posted November 6, 2009 Share Posted November 6, 2009 Use CSS. The proper way is to put it in an external style sheet. W3Schools has a wonderful CSS tutorial.The quick way is this<input type='text' style='color: blue;' /> Link to comment Share on other sites More sharing options...
kirbyweb Posted November 6, 2009 Author Share Posted November 6, 2009 I meant the Username: <input.......Part. Link to comment Share on other sites More sharing options...
ShadowMage Posted November 6, 2009 Share Posted November 6, 2009 If you want to change the text "Username" to a different color, either change the style of the form or wrap the text in <span> tags.Changing the form will change all of the text in that form.Using <span> tags will change just the part inside the tags:<span style='color: blue;'>Username</span><input ... Link to comment Share on other sites More sharing options...
kirbyweb Posted November 6, 2009 Author Share Posted November 6, 2009 The span did not work. Link to comment Share on other sites More sharing options...
ShadowMage Posted November 6, 2009 Share Posted November 6, 2009 The span did not work.Didn't work? Hmm...could you post your code with the span?I tested it out in FF and IE and it worked in both. Link to comment Share on other sites More sharing options...
kirbyweb Posted November 6, 2009 Author Share Posted November 6, 2009 <form action='login.php' method='POST'><span style='color: blue;'>Username:</span><input type="text" name="username">Password: <input type='password' name='password'><br><input type='submit' value='Log in'></form> Link to comment Share on other sites More sharing options...
kirbyweb Posted November 6, 2009 Author Share Posted November 6, 2009 Also around the inputs how do I make it black? Link to comment Share on other sites More sharing options...
ShadowMage Posted November 6, 2009 Share Posted November 6, 2009 I copied and pasted your code and it works fine in both FF and IE. I'm not sure why it wouldn't work for you Also around the inputs how do I make it black?You mean the border? That would be:<input type='text' style='border-color: black;' />Just thought of something. Try using hex values instead:Black would be: style='border-color: #000000;'Blue would be: style='border-color: #0000FF;'See if that works. Link to comment Share on other sites More sharing options...
kirbyweb Posted November 6, 2009 Author Share Posted November 6, 2009 Here pm me your email so I can email you my full code Thanks. Link to comment Share on other sites More sharing options...
ShadowMage Posted November 6, 2009 Share Posted November 6, 2009 Here pm me your email so I can email you my full code Thanks.Sent a message, waiting for the email.Like I said I'm not a pro by a long shot but I'll give it a try. Link to comment Share on other sites More sharing options...
kirbyweb Posted November 6, 2009 Author Share Posted November 6, 2009 I sent one awhile ago, did you get it? Link to comment Share on other sites More sharing options...
ShadowMage Posted November 6, 2009 Share Posted November 6, 2009 Well for starter's you're going to want to clean up your code. This is really old style coding.The <title> tag should be inside the <head> and you should declare a !DOCTYPE.Also you have a duplicated section in your code:<OPTION VALUE="url">Warlords Heroes</SELECT><DIV></FORM></SELECT><DIV></FORM><br><br><br><form action='login.php' method='POST'>The extra:</SELECT><DIV></FORM>might be throwing your document out of whack, not sure.Aside from that, I copied your code to a new document and tried it in Firefox 3.5 and in IE 8. Both browsers colored the username, so if it's still not working, I'm at a loss.Sorry I couldn't be of more help. Link to comment Share on other sites More sharing options...
kirbyweb Posted November 6, 2009 Author Share Posted November 6, 2009 I sent you another email. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.