CSS
Resizing Form Input Boxes, Buttons, and Text with CSS
Resizing Form Input Boxes, Buttons, and Text with CSS
Thanks to the magical process of CSS you are not limited to the standard size boxes, buttons and the actual input text for your web forms. Here's a quick and easy way to change the size of input boxes, submit and reset buttons, and the actual text your visitors input into your web forms.
Copy/paste the custom class CSS code below into your external stylesheet. If you are not familiar with the different methods of CSS and how or when to use them, be sure to read our article, External, Internal or Inline? Which Method is Best?"
.form { font-size: 9px; color=#990000; }
The font-size property in this code is set to 9 pixels and controls the size of the input box, text entered into the input box and the text on the submit button if this custom class is assigned to these HTML form elements. We also added the color property and indicated a red hex code. This displays red text that is entered into the input boxes. See below:
Name: <input type="text" name="name" class="form"> Email: <input type="text" name="email" class="form"> <input type="submit" name="Submit" value="Submit" class="form">
You could easily create a separate form custom classes for your submit button and resize or recolor it as you wish using this same concept.
Click Here to view live comparison examples of a standard web form and a revised version using this mini-tutorial.
Related Articles:
Colorize Your Web Page Forms using CSS Removing Space Around Forms HTML Forms: Is Your Site Interactive? Custom Form Buttons Drawing Attention to Your Forms
|