You are here: Re: vertical alignment « HTML « IT news, forums, messages
Re: vertical alignment

Posted by mardi on 03/21/07 02:31

On Tue, 20 Mar 2007 15:38:49 +0000, Spartaco wrote:

> Hi, this is a big problem for me I can't solve it: I have a <div>, and I
> want the content of this div be vertically aligned in the middle by
> applying CSS styles to the div tag... I've tried the vertical-align but
> it does not work, the content is always at the top.
>
>
Hi, I am but a humble student of the css-fu. I had the same issue arise in
my studies and I did this:

div.container { top: 0; left: 0; width: 100%; height: 100%; position:
fixed; display: table }

div.cell { display: table-cell; vertical-align: middle }

then:

<div class="container">
<div class="cell">
<p>My Content</p>
</div></div>

This works for vertical alignment in the latest versions of Firefox (I
tried it in Linux and MS), Opera (Linux) and Konqueror (obvious :p) but it
does not seem to work in IE 6 & 7.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация