/ Published in: CSS
                    
                                        
To centre, make "line-height" the same as the div height.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<style>
#links{
border: 1px solid #eee;
height: 50px;
line-height: 50px;
}
#links ul
{
margin: 0px;
padding: 0px;
float: left;
list-style-type: none;
}
#links ul li {
margin-right: 20px;
padding: 0px;
display: inline;
}
</style>
</head>
<body>
<div id="links">
<ul>
<li><a href="#">Link 1 </a></li>
<li><a href="#">Link 2 </a></li>
<li><a href="#">Link 3 </a></li>
</ul>
</div>
</body>
</html>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                