html - spacing issue on css drop down menu, cannot center text and cannot get rid of excess left side space -


okay, created drop down menu.

before added ul , li tags, centered fine. won't center. tried adding left/right auto, text-align center , going div tag , putting align center, nothing works. added space of menu items, overall nothing looks spaced.

my second issue on drop downs, there appears left side spacing , cannot figure out why there or how rid of it. appreciated. thank you!

here html:

<div id="menu" align="center">     <ul>         <!-- main ul tag -->         <li><a href="#">home</a>          </li>         <!-- close home li tag -->         <li class="aboute"><a href="#">about ebenezer</a>              <ul>                 <!-- ebenezer menu -->                 <li class="aboute"><a href="#">our history</a>                 </li>                 <li class="aboute"><a href="#">our pastor</a>                 </li>                 <li class="aboute"><a href="#">services</a>                 </li>             </ul>             <!-- close ebenezer menu -->         </li>         <!-- close ebenezer li tag -->         <li class="min"><a href="#">ministries</a>              <ul>                 <!-- ministries menu -->                 <li><a href="#">women</a>                 </li>                 <li><a href="#">men</a>                 </li>                 <li><a href="#">youth</a>                 </li>             </ul>             <!-- close ministries menu -->         </li>         <!-- close ministries li tag -->         <li class="min"><a href="#">community</a>              <ul>                 <!-- community menu -->                 <li><a href="#">backpack buddies</a>                 </li>                 <li><a href="#">outreach</a>                 </li>             </ul>             <!-- close community menu -->         </li>         <!-- close community li tag -->         <li class="min"><a href="#">events</a>              <ul>                 <!-- events menu -->                 <li><a href="#">calendar</a>                 </li>                 <li><a href="#">events</a>                 </li>             </ul>             <!-- close events menu -->         </li>         <!-- close events li tag -->         <li class="photos"><a href="#">photos</a>          </li>         <!-- close photos li tag -->         <li class="non-list"><a href="#">contact</a>          </li>         <!-- close contact li tag -->     </ul>     <!-- end of main ul tag --> </div> <!-- end of menu --> 

here css:

#menu {     height: 40px;     width: 1104px;     padding-top: 2px;     background-color: #0c495c;     margin-right: auto;     margin-left: auto;     font-family: choco;     font-size: 38px;     color: #ffffff;     text-align: center; } #menu ul {     padding: 0px;     margin:0px 0px 0px 0px;     text-align: center; } #menu ul li {     float: left;     position: relative;     background-color: #0c495c;     list-style-type: none;     width: 150px;     padding: 0px; } #menu ul li.non-list {     float: left;     position: relative;     background-color: #0c495c;     list-style-type: none;     width: 100px; } #menu ul li.aboute {     float: left;     position: relative;     background-color: #0c495c;     list-style-type: none;     width: 195px;     margin-left: -10px;     padding: 0px;     left: 15px; } #menu ul li.min {     left: 15px; } #menu ul li.photos {     float: left;     position: relative;     background-color: #0c495c;     list-style-type: none;     width: 160px; } #menu ul li {     color: #fff;     text-decoration: none;     display: block; } #menu ul ul {     position: absolute;     visibility: hidden; } #menu ul li:hover ul {     visibility: visible; } #menu ul li ul li a:hover {     color: #f3b830; } #menu ul li a:hover {     color: #f3b830; } 

you can fix spacing issue between menu items specifying height <li> , pulling submenus down applying top equal height set <li>

jsfiddle

it's better avoid tags , properties such align styling purpose , styling using css


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -