Is it possible to center something without using margin: auto;? My div cannot be a set size because the width will change according to it's contents and even so I would not know how wide it would be since it's text inside (There is a div around text because there are multiple <p>
's). Is there any other way of aligning in center without knowing your width of the object?
div#contents {
display: inline-block;
margin: 50px 100px 50px 100px;
border: 3px solid black;
}
table#socialmedia {
height: 100px;
margin-top: 10px;
float: left;
}
table#support {
height: 25px;
margin-top: 10px;
float: left;
}
table#external {
margin-top: 10px;
float: left;
}
div#footerdivider {
width: 1px;
height: 120px;
margin: 0px 50px 0px 50px;
background-color: #424242;
float: left;
}
p.footerlinks {
font-size: 20px;
color: #8C8CFF;
text-align: center;
<div id="contents">
<table id="socialmedia">
<tr><td><a href=""><p class="footerlinks">Facebook</p></a></td></tr>
<tr><td><a href=""><p class="footerlinks">Twitter</p></a></td></tr>
<tr><td><a href=""><p class="footerlinks">YouTube</p></a></td></tr>
<tr><td><a href=""><p class="footerlinks">Steam</p></a></td></tr>
</table>
<div id="footerdivider">
</div>
<table id="support">
<tr><td><a href=""><p class="footerlinks">Email Us (Click to copy)</p></a></td></tr>
</table>
<div id="footerdivider">
</div>
<table id="external">
</table>
</div>