사용자가 사진 갤러리를 통해 정렬 할 수있는 탐색 모음이 있습니다. 문제는 탐색 막대 너비가 갤러리의 크기에 따라 달라질 것입니다. 너비를 설정하지 않으면 여백을 사용할 수 없습니다. 0 자동; 메뉴를 가운데에 맞 춥니 다. (대신, 모든 갤러리 컨테이너의 왼쪽에 표시됩니다.) 여기 HTML/CSS - 가변 크기의 가운데 탐색 모음
는 HTML입니다 : <div id="nav_container">
<div id="timeline_nav">
<!--<a class="arrow left" />-->
<a class="toggle"/>
<a class="toggle"/>
<a class="toggle"/>
<a class="toggle"/>
<!--<a class="arrow right disabled" />-->
</div>
</div>
그리고 CSS :
#nav_container { width:100%;height:20px; position:absolute; bottom:10px; background-color:#000;}
#timeline_nav { position:relative;margin:0 auto; }
#timeline_nav a { display:block; float:left; cursor:pointer; overflow:hidden; }
#timeline_nav a.toggle { width:4px; height:4px; padding:2px; margin:0 2px; background:url(http://images.apple.com/iphone/gallery/images/nav-ticks-20100607.png) 50% 0 no-repeat; }
모든 아이디어를 어떻게 해결 이?
당신은 디스플레이를 적용 할 수 있습니다 : 인라인 블록, 그리고 너비 (그것 doesnt 작동 n ie6 생각) 줄 것이다 .. 또한 당신이 그것을 그런 식으로 센터 수있는 갤러리에 대한 자바 스크립트를 사용하는 경우. – amosrivera