/ Published in: CSS
Useful bit of CSS to vertically centre a navigation. Good for Pagination.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<style type="text/css"> #nav { margin: 0 auto; text-align: center; } #nav li { display: inline; vertical-align: middle; } #nav li a { display: inline-block; } </style> <body> <ul id="nav"> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> <li><a href="#"></a></li> </ul> </body>
URL: http://csswizardry.com/2011/01/create-a-vertically-centred-horizontal-navigation/