/ /このCodePenの中央の要素を整列する方法は? -html、css、css3

このCodePenの中心要素を揃える方法は? - html、css、css3

http://codepen.io/leongaban/pen/ACJta
^更新(CodepenでSASSを正しく動作させることはできません)

上記の要素を中央に揃えることができません。SASSを使用して、使用を避けたい position ハック

<main>
<div class="gradient">
<div class="hero">
<img src="/images/http://placehold.it/350x150" alt=""/>
</div>
</div>

<section class="tagline">
<h1>Hi there Lorem Ipsum <em>My name is Bob</em></h1>
<button>Learn More</button>
</section>
</main>


body {
font-family:Arial
}

.hero {
display: table-cell;
//position: relative;
margin: 0 auto;
// top: 42%;
// left: 10%;
text-align: center;
width: auto;
height: 447px;
vertical-align: bottom;

img {
width: 300px;
height: 280px;
text-align: center;
vertical-align: bottom;
border:0;
}
}

.tagline {
position: relative;
margin: 0 auto;
width: 100%;
height: 300px;
text-align: center;
color: blue;
background: gray;
z-index: 2;

h1 {
margin: 0 auto;
padding-top: 5%;
width: 80%;
font-size: 42px;
text-align: center;
}

em {
font-weight: bold;
}

button {
margin-top: 25px;
padding: 10px 20px;
font-family: Arial;
font-size: em(21);
color: white;
border: 0;
background: orange;
}
}

回答:

回答№1は0

私はあなたの要素を以下のことを行うことの中心に置くことができました:

.hero {
margin: 0 auto;
text-align: center;
width: 50%;
height: 447px;
vertical-align: bottom;
}

指定したため、センタリングしたくないようです width: auto