开发者

How to align section on center in horizontal navigation?

My website is for horizontal navigation with section 960px who are call with anchors (such as a slide show) and I wanted to align my sections with center, depending on the size of the window.

This the code :

 <div id="wrapper">
    <div cla开发者_C百科ss="section" id="section1">test</div>
    <div class="section" id="section2">test2</div>
    <div class="section" id="section3">test3</div>
    <div class="section" id="section4">test4</div>
  </div>

#wrapper{
  position:absolute;
  left: 10%;
  width: 5000px;
}

.section{
  width: 960px;
  height: 576px;
  float: left;
}

Is align center when I load page but not with navigation anchor.

Help me please

Thanks.


Could you not do something similar?...

.wrapper {width:960px;}
ul#nav {width:auto; margin:0 auto;}

<div class="wrapper">
    <ul id="nav">
        Nav links
    </ul>
</div>


use

 display : table-cell;
 vertical-align : middle;

Reference

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜