我想將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