Page Widget How to - Center Text of Menu








Question

We would like to know how to center Text of Menu.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#header {<!-- w ww  .j a  v  a  2 s.  c  o  m-->
  padding: 35px 0;
}

#menu {
  background: #EEE;
  border-bottom: 3px solid #0F0;
}

#menu ul {
  list-style-type: none;
  width: 350px;
  margin: 0 auto;
  padding: 0;
  background: #DDD;
}

#menu ul li {
  display: inline;
  padding: 5px 10px;
}
</style>
</head>
<body>
<body>
  <div id="header">header section</div>
  <div id="menu">
    <ul>
      <li>option 1</li>
      <li>option 2</li>
      <li>option 3</li>
    </ul>
  </div>
  <div id="content">content</div>
</body>
</body>
</html>

The code above is rendered as follows: