我喜欢让我的示例更大,以便我可以在 div1、div2、div3 和 div4 下并排放置 2 个或更多图像。现在,示例一的宽度似乎是固定的,每次我尝试设置宽度时,它都会把页面搞砸。我无法弄清楚这一点。非常感谢任何帮助。
CSS:
#example-one {
background: inherit;
padding: 10px;
-moz-box-shadow: 0 0 5px #666;
-webkit-box-shadow: 0 0 5px #666;
margin: auto;
}
#example-one .nav {
overflow: hidden;
margin: 0 0 0 0;
}
#example-one .nav li { width: 97px; float: left; margin: 0 10px 0 0; }
#example-one .nav li.last { margin-right: 0; }
#example-one .nav li a { display: block; padding: 5px; background: #959290; color: white; font-size: in; text-align: center; border: 0; }
#example-one .nav li a:hover { background-color: #111; }
#example-one ul { list-style: none; }
#example-one ul li a { display: block; border-bottom: 1px solid #666; padding: 4px; color: #666; }
#example-one ul li a:hover { background: #fe4902; color: white; }
#example-one ul li:last-child a { border: none; }
#example-one ul li.nav-one a.current, #example-one ul.featured li a:hover { background-color: #0575f4; color: white; }
#example-one ul li.nav-two a.current, #example-one ul.core li a:hover { background-color: #d30000; color: white; }
#example-one ul li.nav-three a.current, #example-one ul.jquerytuts li a:hover { background-color: #8d01b0; color: white; }
#example-one ul li.nav-four a.current, #example-one ul.classics li a:hover { background-color: #FE4902; color: white; }
这是html:
<div id="example-one" style="margin: 0 auto;">
<ul class="nav" style="margin:auto;">
<div id="tab-section" style="position:absolute;left:50%;">
<li class="nav-one"><a href="#div1" class="current">Content1</a></li>
<li class="nav-two"><a href="#div2">Content2</a></li>
<li class="nav-three"><a href="#div3">Content3</a></li>
<li class="nav-four last"><a href="#div4">Content4</a></li>
</div>
</ul>
<ul id="div1">
<li id="section1></li>
<li id="section2></li>
<li id="section3></li>
<li id="section4></li>
</ul>
<ul id="div2" class="hide">
</ul>
<ul id="div3" class="hide">
</ul>
<ul id="div4" class="hide">
</ul>