How to Align a Text Field in HTML Form
The "align" attribute is used to correctly align a text field in reference to the text around it. The "align" attribute for the text field uses the same variables as the "align" attribute for images. "Left" places the text field against the left margin, with the text appearing to the right of the field. "Right" places the field against the right margin. "Texttop" aligns the field with the top of the tallest letter in the current line. "Absmiddle" aligns the field with the center of the current line. "Absbottom" aligns the field with the bottom of the current line.
Instructions
-
-
1
Open a blank document in any text editor such as Windows Notepad.
-
2
Create the HTML document as you normally would.
-
-
3
Type the line "<input type="text" size="25" align="absmiddle"> to create a text field that is aligned with the middle of the current line.
-
4
Finish the HTML document.
-
5
Save the document with the ".html" file extension.
-
6
View the alignment by opening the document in a web browser.
-
1