W3C home > Mailing lists > Public > www-style@w3.org > July 2006

RE: Center text in <div>

From: Benton, Kevin <kevin.benton@amd.com>
Date: Thu, 13 Jul 2006 13:41:33 -0700
Message-ID: <D85E06673A2DFF44B221CF78D1CBB11B8FEA1F@SSVLEXMB1.amd.com>
To: www-style@w3.org

I may be somewhat off on this, but have you tried vertical-align:
middle; ?  Be aware that this only works for inline and table cell
elements.

---
Kevin Benton
Perl/Bugzilla Developer/Administrator, Perforce SCM Administrator
AMD - ECSD Software Validation and Tools
 
The opinions stated in this communication do not necessarily reflect the
view of Advanced Micro Devices and have not been reviewed by management.
This communication may contain sensitive and/or confidential and/or
proprietary information.  Distribution of such information is strictly
prohibited without prior consent of Advanced Micro Devices.  This
communication is for the intended recipient(s) only.  If you have
received this communication in error, please notify the sender, then
destroy any remaining copies of this communication.

> How can I vertically center text in <div> </div>?
> 
> I have made this protosite and can't vertically center the menus.
> 
> http://codg.bjaili.com/
> 
> my css:
> 
> html
> {
>   direction:rtl;
> 
> }
> 
> #container
> {
>     width: 780px;
>     margin-left: auto;
>     margin-right: auto;
> }
> 
> #uppermenu
> {
>   width: 780px;
>   height:40px;
>   border: solid;
>   border-width:1px;
> }
> 
> ul#unav
> {
>  list-style-type: none;
>  width: 100%;
>  margin-right: 0;
>  padding-right:0;
>  float:right;
> 
> }
> 
> ul#unav li
> {
>   display: inline;
>  }
> 
> #logo
> {
>  width: 780px;
>  height: 110px;
>  border: solid;
>  border-width: 0px 1px 1px 1px;
> }
> 
> #lowermenu
> {
>   width: 780px;
>   height:30px;
>   border: solid;
>   border-width: 0px 1px 1px 1px;
> }
> 
> ul#lnav
> {
>  padding-right: 0px;
>  padding-top: 0px;
>  list-style-type: none;
>  width: 100%;
>  margin-top:auto;
>  margin-bottom:auto;
> 
> }
> 
> ul#lnav li
> {
>   display: inline;
> }
> 
> #right-menu
> {
>  float: right;
>  width: 130px;
>  height: 300px;
>  border: solid;
>  border-width: 0px 1px 1px 0px;
> }
> 
> #content
> {
>  width: 650px;
>  height: 300px;
>   border: solid;
>   border-width: 0px 1px 1px 1px;
>  margin-right: 130px;
> }
> 
> #footer
> {
>     width:780px;
>       border: solid;
>   border-width: 0px 1px 1px 1px;
>     clear: both;
> }
> 
> 
> 
> 
> 
> --
> OOzy
> Kubuntu-Dapper
> 
> 
Received on Thursday, 13 July 2006 20:41:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:46 GMT