1

私はバンド向けのモバイル アプリを構築していますが、明らかに、今日の多数のハンドセットで適切に表示されるようにしたいと考えています。最初は自分のデバイス用に作成しましたが、見た目も機能も優れているため、すべてのデバイスで機能するようにパーセンテージで再加工しています。

スライダー(jquerytools)が進行中で、幅を100%に設定すると、iPhoneとiPadで完全に幅が広くなります...成功しましたが、高さには運がありません。px 単位の高さしか受け付けないようです。高さをパーセントで設定すると、表示されません。

何か案は?

更新された CSS:

#header{
width:100%;

position:relative;
z-index: 20;
box-shadow: 0 0 10px white;
}

.scrollable {
position:relative;
overflow:hidden;
width: 100%;
height: 100%;
box-shadow: 0 0 20px purple;
/*  height:198px; */
z-index: 20;
}


.scrollable .items {
/* this cannot be too large */
width:1000%;
position:absolute;
clear:both;
box-shadow: 0 0 30px green;

}

.items div {
float:left;
width:10%;
height:100%;

}

/* single scrollable item */
.scrollable img {
    float:left;
    width:100%;
   height: auto;
 /*    height:198px; */
}

/* active item */
.scrollable .active {
    border:2px solid #000;
    position:relative;
    cursor:default;
}
4

1 に答える 1

0

あなたの要素が であってはならないならposition:relative、私はそうします

.scrollable {
   position:absolute; // instead of relative
   overflow:hidden;
   width: 100%;
   top:0;
   bottom:0;// instead of height: 100%;
   box-shadow: 0 0 20px purple;
   /*  height:198px; */
   z-index: 20;
}

基本的に、位置を絶対位置として定義し、要素が上からゼロで始まり、下からゼロで始まるという事実を追加しました。これは、height:100%;

于 2012-11-16T12:24:04.020 に答える