OZONE Asylum
Forums
DHTML/Javascript
Vertically Centering a textbox in a DIV
This page's ID:
27895
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
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>[/code] It's fine until the text wraps onto two lines, but is very effecttive otherwise. Dan
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »