We would like to know how to center Text in a centered div.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
div {<!-- w w w .j a v a 2 s .c o m-->
background: red;
bottom: 0;
height: 100px;
left: 0;
margin: auto;
position: absolute;
top: 0;
right: 0;
width: 100px;
display: table;
}
span {
display: table-cell;
text-align: center;
vertical-align: middle;
}
</style>
</head>
<body>
<div>
<span>Absolute center</span>
</div>
</body>
</html>
The code above is rendered as follows: