By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,493 Members | 1,936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,493 IT Pros & Developers. It's quick & easy.

Vertically aligning to the middle in a fixed div?

P: n/a
Hi.

I've got a few divs on a page that are positioned as "fixed". I now want
my text to centre itself both horizontally and vertically. "text-align:
center" on the body works for horizontal, but I can't seem to get the
text to move from the top of each div. Any suggestions?

Incidentally, the page layout I'm aiming for is as follows:

..-------------------------------------------.
| .-------.-------.-------. |
| | | | | |
| | TXT | TXT | TXT | |
| | | | | |
| |-------+-------+-------| |
| | | | | |
| | TXT | TXT | TXT | |
| | | | | |
| |-------+-------+-------| |
| | | | | |
| | TXT | TXT | TXT | |
| | | | | |
| |-------+-------+-------| |
| | Extra centered text | |
| '-----------------------' |
'-------------------------------------------'

The outer rectangle is supposed to be the viewport. This is easy with
tables, but I'm currently using fixed divs for the ten rectangles. Is
there a better way to do this?

Thanks,

Iain Hallam.
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mon, 01 Mar 2004 16:41:03 +0000, Iain Hallam wrote:
I now want
my text to centre itself both horizontally and vertically.


http://www.quirksmode.org/css/centering.html
http://www.wpdfd.com/editorial/thebox/deadcentre4.html

--

..

Jul 20 '05 #2

P: n/a
Vigil wrote:
Iain Hallam wrote:
I now want my text to centre itself both horizontally and vertically.

http://www.quirksmode.org/css/centering.html
http://www.wpdfd.com/editorial/thebox/deadcentre4.html


Thanks - that's got it working, although I've had to go back to a table
design. The markup is much smaller and the CSS less twisted with a table
for this site.

- Iain.
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.