How do you properly align a span both horizontally and vertically central in an li using CSS?
There's probably more than one way to do it(?) but what is the correct or best way to do it and ensure it is truly centred horizontally and vertically?
There are similar questions in other scenarios but not that work with the li.
This is what I have so far...
html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link href="css/list.css" rel="stylesheet" />
<title></title>
</head>
<body>
<div>
<ul id="aList">
<li><span>Bob Smith</span></li>
<li><span>Joe</span></li>
<li><span>Lisa Henson</span></li>
<li><span>Freddy Tallman</span></li>
<li><span>Sarah Jones</span></li>
</ul>
</div>
</body>
</html>
css:
body {
}
#aList {
height: auto;
list-style:none;
margin: 5px, 5px, 5px, 30px;
font-size: 20px;
border: 1px red solid;
padding: 5px;
width: 500px;
display: inline-block;
text-align:center;
}
#aList li {
text-align: center;
min-height: 50px;
height: auto;
border: 1px green solid;
padding: 2px;
margin: 10px;
}
#aList li span {
border: 1px blue solid;
}