Jump to content

HTML Form Text Field


affc

Recommended Posts

Gday all,

 

I have finally worked out how to change the background of a Text Field but I cannot find anywhere how to change the Text of a Text Field and also to Center the Text in the Text Field:

 

<HTML>
<HEAD>
</HEAD>
<BODY>
<form method=post action="/cgi-bin/vform">
<input type="text" name="text" style="background-color: tan;">
<input type=submit value="Submit">
</form>

</BODY>
</HTML>

Link to comment
https://forums.phpfreaks.com/topic/111458-html-form-text-field/
Share on other sites

<HTML>

<HEAD>

</HEAD>

<BODY>

<form method=post action="/cgi-bin/vform" align="center">

<center>

<input type="text"  name="text" style="background-color: tan; color:green;">

<input type=submit value="Submit">

</form>

</center>

</BODY>

</HTML>

 

This will not validate. The <center> tag's aren't placed in correct order. Futhermore, <center> is deprecated. Use CSS, margin: 0 auto; to achieve the same result.

 

If you want to center text:

 

text-align: center;

 

If you want to center the whole text box

 

margin: 0 auto;

Link to comment
https://forums.phpfreaks.com/topic/111458-html-form-text-field/#findComment-572601
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.