IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Text Color In Form
kirbyweb
post Nov 6 2009, 07:58 PM
Post #1


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



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:

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.

This post has been edited by kirbyweb: Nov 6 2009, 07:59 PM
Go to the top of the page
 
+Quote Post
jkloth
post Nov 6 2009, 08:06 PM
Post #2


Newbie
*

Group: Members
Posts: 69
Joined: 3-September 09
Member No.: 33,550
Languages: HTML, JavaScript, PHP (though I still have much to learn)



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;' />
Go to the top of the page
 
+Quote Post
kirbyweb
post Nov 6 2009, 08:29 PM
Post #3


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



I meant the Username: <input.......

Part.
Go to the top of the page
 
+Quote Post
jkloth
post Nov 6 2009, 08:33 PM
Post #4


Newbie
*

Group: Members
Posts: 69
Joined: 3-September 09
Member No.: 33,550
Languages: HTML, JavaScript, PHP (though I still have much to learn)



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 ...
Go to the top of the page
 
+Quote Post
kirbyweb
post Nov 6 2009, 08:42 PM
Post #5


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



The span did not work.
Go to the top of the page
 
+Quote Post
jkloth
post Nov 6 2009, 08:45 PM
Post #6


Newbie
*

Group: Members
Posts: 69
Joined: 3-September 09
Member No.: 33,550
Languages: HTML, JavaScript, PHP (though I still have much to learn)



QUOTE (kirbyweb @ Nov 6 2009, 02:42 PM) *
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.
Go to the top of the page
 
+Quote Post
kirbyweb
post Nov 6 2009, 08:49 PM
Post #7


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



CODE
<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>


This post has been edited by kirbyweb: Nov 6 2009, 08:50 PM
Go to the top of the page
 
+Quote Post
kirbyweb
post Nov 6 2009, 08:51 PM
Post #8


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



Also around the inputs how do I make it black?
Go to the top of the page
 
+Quote Post
jkloth
post Nov 6 2009, 09:03 PM
Post #9


Newbie
*

Group: Members
Posts: 69
Joined: 3-September 09
Member No.: 33,550
Languages: HTML, JavaScript, PHP (though I still have much to learn)



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

QUOTE (kirbyweb @ Nov 6 2009, 02:51 PM) *
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.
Go to the top of the page
 
+Quote Post
kirbyweb
post Nov 6 2009, 09:20 PM
Post #10


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



Here pm me your email so I can email you my full code Thanks.
Go to the top of the page
 
+Quote Post
jkloth
post Nov 6 2009, 09:30 PM
Post #11


Newbie
*

Group: Members
Posts: 69
Joined: 3-September 09
Member No.: 33,550
Languages: HTML, JavaScript, PHP (though I still have much to learn)



QUOTE (kirbyweb @ Nov 6 2009, 03:20 PM) *
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.
Go to the top of the page
 
+Quote Post
kirbyweb
post Nov 6 2009, 09:43 PM
Post #12


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



I sent one awhile ago, did you get it?
Go to the top of the page
 
+Quote Post
jkloth
post Nov 6 2009, 09:47 PM
Post #13


Newbie
*

Group: Members
Posts: 69
Joined: 3-September 09
Member No.: 33,550
Languages: HTML, JavaScript, PHP (though I still have much to learn)



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.
Go to the top of the page
 
+Quote Post
kirbyweb
post Nov 6 2009, 10:04 PM
Post #14


Member
**

Group: Members
Posts: 169
Joined: 16-October 09
Member No.: 34,563



I sent you another email.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2009 - 12:22 AM