0
我找到了很棒的滑塊http://unslider.com/但我的項目有很多問題。全屏li滑塊100%高度不起作用
我嘗試將此滑塊設置爲全屏頁面的背景,但我的li元素不是窗口(容器)的100%高度。
<body>
<!--- Always on top --->
<section class="content">
<nav>
<ul>
<li id="fotograf_pg1_btn">1btn</li>
<li id="fotograf_pg2_btn">2btn</li>
<li id="fotograf_pg3_btn">3btn</li>
</ul>
</nav>
</section>
<!---------------------->
<!-----as a background ---------->
<div class="unslider">
<ul>
<!-------------- Slide fotograf ślubny ------------->
<li id="fotograf_pg1"> Fotograf zakładka 1</li>
<!-------------- Slide Fotograf prouktowy ------------->
<li id="fotograf_pg2"> Fotograf zakładka 2</li>
<!-------------- Slide Fotograf prouktowy ------------->
<li id="fotograf_pg3"> Fotograf zakładka 3</li>
</ul>
</div>
</body>
我混合的方法,但什麼都沒有。 jQuery將解決這個問題,但我想用純CSS,如果有可能
.unslider { position: relative; overflow: hidden;
height: auto !important;/
min-height: 100%; /* ie6 ignores min-height completely */
height: 100%;
width:100%;
background-color: red; /* just for presentational purposes */
position: absolute; overflow:hidden;
top:0px;
z-index:-1;
}
.unslider li {
list-style:none;
display: inline-block;
height: 100%;
width:100%;
}
.unslider ul li {
float: left;
display: inline-block
height: auto !important; /* ie6 ignores !important, so this will be overridden below */
min-height: 100%; /* ie6 ignores min-height completely */
height: 100%;
width:100%;
}
.unslider ul{
display:block;
height: 100%;
width:100%;
}
嘗試使用行高而不是高度; – Phorden