グラデーションの色の背景を実装しようとしています。ここに関係するコードがあります。グラデーションの背景が上から下まで伸びない
#grad {
background: -webkit-linear-gradient(red, white, blue);
background: -moz-linear-gradient(red, white, blue);
background: -o-linear-gradient(red, white, blue);
background: linear-gradient(red, white, blue);
}
<body id="grad">...</body>
しかし、これは私のナビゲーションバーまでの背景をカバーして、背景は繰り返します。
#grad {
background: -webkit-linear-gradient(red, white, blue);
background: -moz-linear-gradient(red, white, blue);
background: -o-linear-gradient(red, white, blue);
background: linear-gradient(red, white, blue);
height: 100%;
width: 100%;
left: 0px;
top: 0px;
z-index: 0;
position: absolute;
}
<body id='grad'>...</body>
だけが消える背景:私は、次のコードを試してみました。助けてください。
私はリピートを添加しない試みたが、背景は、まだナビゲーションバーまで停止します。私は高さを追加しようとしました:100%、しかし変化はありませんでした。 –
Divタグを付けてもう一度お試しください。 bodyタグに 'position:absolute'を使用しないでください。 –