Is there a way to centrally align a div element that doesn't have a set width?
<html>
<head>
<title></title>
<style type="text/css">
.outer {
padding: 10px;
/*margin: auto; (doesn´t work)*/
background-color: #000;
display: inline-block;
}
.inner {
width: 400px;
height: 400px;
text-align: center;
background-color: #CCC;
}
</style>
</head>
<body>
<div class="outer">
<div class="inner"></div>
</div>
</body>
</html>
Are there any solutions that don't involve setting a specific width?