html - Aligning Horizontal UL Menu in DIV -


struggling horizontal ul menu center in parent div.

rather annoying, because it's literally out 10-20px.

any great, thanks!

https://jsfiddle.net/xd5cxngt/

html

<div id="navbar">         <ul id="menu">             <li><a href="index.html">home</a></li>             <li><a href="the-isle-of-wight.html">the isle of wight</a></li>             <li><a href="your stay">your stay</a></li>             <li><a href="booking">booking</a></li>             <li><a href="contact us">contact us</a></li>         </ul>     </div> 

css

#navbar {     background-color: #dddddd;     text-align: center;     height: 28px;     max-width: 100%;     min-width: 960px;     margin: 0 auto; } ul#menu li {     display: inline-block; } ul#menu li {     background-color: #4d4d4d;     color: #ffffff;     padding: 10px 20px;     text-decoration: none; } 

just remove line min-width: 960px;in navbar div , should work. here working example: https://jsfiddle.net/84etsxzn/


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -