I have two divs. The wrapper div (divider_header
) is positioned relative and has a float to the left while its child (divider_txt
) is positioned absolute.
<div class="divider_header">
<div class="divider_txt">Friend Requests</div>
</div>
I'd like to know how can I center text horizontally inside of the divider_txt
wrapper?
CSS (doesn't work):
.divider_header {
display: table;
position: relative;
border-bottom: 1px solid #666;
padding: 1px 0;
width: 418px;
margin: 0 auto;
float: left;
}
.divider_txt {
display: table-cell;
text-align: center;
font-size: 13px;
font-family: "Open Sans Condensed", Arial, sans-serif !important;
vertical-align: middle;
position: absolute;
z-index: 2;
background-color: #121219;
}