Topic: Vertically Centering a textbox in a DIV |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: Indiana, PA |
posted 05-06-2006 16:36
Is there any way to vertically center a textbox in a DIV? |
Bipolar (III) Inmate From: London |
posted 05-13-2006 15:18
It sure is. How you go about doing it will depend on your exact requirements, however, as different methods have different pros and cons. Take this, for example: code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <meta http-equiv="content-language" content="en"> <title>Horizontal centering demo</title> <style type="text/css"> div { height: 10em; line-height: 10em; background-color: #CC0000; } </style> </head> <body> <div> This will be centred horizontally </div> </body> </html>
|
Maniac (V) Mad Scientist From: :morF |
posted 05-14-2006 04:35
I think he meant a text-box as in the form input box element. |
Bipolar (III) Inmate From: London |
posted 05-15-2006 08:18
Does this help? |