0
ここで、私はスティッキーポジショニングでヘッダ部の下にナビゲーションメニューを作成しようとしていますが、私はそれが仕事を得ることができない私のCSSコード:CSS3 - スティッキー位置が動作しない
body{
}
header{
position: relative;
top: 0px;
left: 0px;
height: 100px;
width: 100%;
background-color: whitesmoke;
text-align: left;
float: left;
padding: 5px;
z-index:100;
}
#logo{
position: relative;
height: 85px;
width: 120px;
/*border: 1px solid black;*/
float: left;
background-image: url('logoArdi.svg');
background-position: center;
background-size: contain;
}
#judulWeb{
position: relative;
height: 85px;
width: 200px;
text-align: center;
float: left;
}
#kontak{
position: inherit;
float: right;
height: 100px;
top: 20px;
right: 10px;
}
.imghead{
margin: auto 5px auto auto;
}
.sticky{
position: sticky;
position: -webkit-sticky;
position: -o-sticky;
top: 0px;
float: left;
width: 100%;
height:30px;
background-color: #26282b;
text-align: center;
box-shadow: 0px 2px 10px #26282b;
}
ul li{
position:relative;
bottom:11px;
display: inline-block;
margin: auto 30px auto auto;
}
ul li{
color:whitesmoke;
/*background-color:black;
border-radius: 5px 5px 0px 0px;
padding: 5px;*/
}
ul li:hover{
color:#26282b;
background-color: whitesmoke ;
}
#kontak{
position: inherit;
float: right;
height: 100px;
}
#wrapper{
position: relative;
top: 132px;
width: 80%;
float: left;
margin-right: 10%;
margin-left: 10%;
text-align: center;
background-color: transparent;
}
.imgutama{
width: 200px;
}
は私にはありません今は間違いですが、私はちょうどページヘッダーとナビゲーションを作成するつもりですが、ナビゲーションはページヘッダーの下にあり、スクロールしても上にスティックします。
注:ナビゲーションクラスは「スティッキー」です。
ポジション:firefoxとsafariでのみスティッキーな作業。 (http://caniuse.com/#search=sticky)これは最高の解決策ではありません – BordiArt
私はjavascriptでつまらないです:)リンクのおかげで! –
問題を解決した場合は、自分で回答を投稿し、回答として回答を選択することができます。ここではタイトルに "SOLVED"はしていません。 – j08691