css - Navigation list is not centering properly -
i'm learning how code wordpress themes currently, , i'm having trouble centering navigation menu. moves far right. have included image illustrate problem code have presented.
here link screenshot of problem: http://i59.tinypic.com/8z1m2o.png
body { font-family: arial, 'helvetica neue', helvetica, sans-serif; font-size: 14px; color: #333; } a:link, a:visited { color: #000; text-decoration: none; } p { line-height: 14px; } /* general layout */ div.container{ max-width: 960px; margin: 0 auto; padding-left: 20px; padding-right: 20px; } article.post { border-bottom: 1px solid #bbbbbb; } article.post:last-of-type{ border-bottom: none; } /* header */ .site-header { border-bottom: 2px solid #999; padding-top: 10px; } /* footer */ .site-footer { margin-top: 0px; border-top: 2px solid #999; margin-left: auto; margin-right: auto; } /* navigation */ .site-nav { position: fixed; left:50%; } .site-nav ul{ background-color: rgba(255,255,255,0.8); padding: 0px; margin: 0px; } .site-nav ul li{ text-align: center; display: inline-block; overflow:hidden; text-decoration: none; margin-right: 10px; padding-right: 10px; border-right: 1px solid #ddd; } .site-nav ul li:last-of-type { border-right: none; }
.site-nav has position: fixed, left: 50% left side of element positioned in middle of screen. remove rule or give element margin-left: -x x equal half of .site-nav's width if must use fixed positioning.
Comments
Post a Comment