我想将div居中在另一个div中。Div在另一个div中居中
这是我的HTML
<div id="runway-category">
<a href="<?php the_permalink() ?>" class="runway-category-posts">
<div class="photo"><?php custom_get_post_attachments(get_the_ID(), $__width, $__height, get_the_title()); ?><div class="runway-title"><?php the_title(); ?></div></div>
</a>
</div>
这是CSS
.runway-category-posts{width:298px;height:500px;margin: 0 9px 18px 9px;float:left;display:block;}
.runway-title{text-align:center;font-family:tall_film;color:#FFF;font-size:20px;}
请告诉我,我应该添加到CSS做是正确的?
编辑 - 这应该在PHOTO DIV居中的DIV是跑道TITLE
尝试'margin-left:auto; margin-right:auto;'特别是'div' –
http://www.jakpsatweb.cz/css/css-vertical-center-solution.html – biziclop