나는 중심에 모든 것을 시도했다. #accordion ul
.jQuery 아코디언이있는이 정렬되지 않은 목록을 가운데에 배치하는 것이 왜 불가능합니까?
제안 사항?
코드 :
CSS :
.container {
margin: 0 auto;
overflow: hidden;
width: 960px;
}
#accordion {
float: left;
position: relative;
width: 940px;
height: 200px;
overflow: hidden;
margin: 25px 0px 0px;
}
#accordion ul {
list-style: none;
margin: 0px;
display: block;
height: 200px;
width: 940px;
}
#accordion ul li {
float: left;
}
#accordion ul li a {
background:#FFFFFF none repeat scroll 0%;
border-right: 2px solid #fff;
cursor:pointer;
display:block;
overflow:hidden;
width:78px;
height: 200px;
}
#accordion ul li.landscapes a {
background: url(../images/landscapes.jpg) repeat scroll 0%;
}
#accordion ul li.people a {
background: url(../images/people.jpg) repeat scroll 0%;
}
#accordion ul li.nature a {
background: url(../images/nature.jpg) repeat scroll 0%;
}
#accordion ul li.abstract a {
background: url(../images/abstract.jpg) repeat scroll 0%;
}
#accordion ul li.urban a {
background: url(../images/urban.jpg) repeat scroll 0%;
min-width:310px;
}
PHP :
<div id="intro">
<div class="container">
<div id="accordion">
<ul>
<?php // Create and run custom loop
$custom_posts = new WP_Query();
$custom_posts->query('post_type=page_content&page_sections=Slider (Front Page)');
while ($custom_posts->have_posts()) : $custom_posts->the_post();
?>
<li class="landscapes"><?php the_content(); ?><></li>
<?php endwhile; ?>
</endwhileul>
</div>
</div><!-- .container -->
</div><!-- #intro -->
참조 이미지 :
'#accordion {float : left; ..'이 이유 일 수 있습니다 .. –
@Avinash - 예. 화면을 보았을 때도 처음 생각했습니다. – easwee
@Avinash '# accordion'이 떠 다니지 않아도 문제는 여전히 남아 있습니다. – alexchenco