css - Centering a Float Left Menu with Unknow Width -


i want li element of ul of menu in center, tried lot of methods not going on. take on css:

#menu {     float: left;     width: 767px;     height: 38px;     margin: 11px 0 0 14px;     background: url(images/menubg.gif) repeat-x;     -webkit-border-radius: 0px 0px 7px 7px;     border-radius: 0px 0px 7px 7px;     border: 1px solid #efeff1; }     #menu ul {         list-style: none;         text-align: center;         padding: 0;         margin: 0;         height: 40px;     }         #menu ul li {             float: left;             color: #767676;             height: 18px;             padding: 11px 0px 11px 0px;             display: inline;         }             #menu ul li {                 font-family: arial, helvetica, sans-serif;                 color: inherit;                 font-size: 12px;                 text-decoration: none;                 font-weight: bold;                 display: block;                 padding: 0px 23px 2px 23px;                 border-left: 1px solid #e0e0e2;             } 

i tried display: inline, text-aling: center, doesnt right. lot in advance.

i removed float , added inline-block instead:

http://jsfiddle.net/dttdg/1/

#menu ul li {     display: inline-block; 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -