當我使用觸控板滾動時,工具欄和主窗口之間有一個白色的間隙(在這個頂部標題上方)。你可以在我附上的圖片中看到它。只有在使用觸控板(不是鼠標)滾動到窗口底部的頂部或底部時纔會出現此間隙。如何設置超出「正常」窗口的背景顏色?當滾動到頂部或底部時操作瀏覽器窗口的顏色
//當我不滾動:
@import url("960_12_col.css");
#header{
background-color: blue;
height: 400px;
margin-top: 80px;
margin-bottom: 30px;
color: white;
padding-left: 50px;
padding-top: 40px;
box-sizing: border-box;
}
.grid_4{
/*
text-align: center;
background-color: red;
margin-top: 30px;
height: 250px;
border: 20px solid black;
box-sizing: border-box;
*/
}
.grid_3{
padding:10px;
border: 5px solid black;
margin: 10px;
height: 140px;
box-sizing: border-box;
}
#comment1{
text-align: left;
}
#comment2{
text-align: center;
}
#comment3{
text-align: center;
}
#comment4{
text-align: right;
}
#leftImage{
}
#centerImage{
}
#rightImage{
}
.image{
text-align: center;
background-color: red;
margin-top: 30px;
height: 250px;
border: 20px solid black;
box-sizing: border-box;
}
.text{
text-align: left;
background-color: #C6E2FF;
margin-top: 5px;
height: 50px;
border: 5px solid black;
box-sizing: border-box;
}
body{
/*
background-image: url("images/kaktus2.jpg");
background-repeat:repeat;
*/
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#66cccc), to(#336666));
/* Safari 5.1+, Chrome 10+ */
background-image: -webkit-linear-gradient(#336666, #66cccc);
background-attachment: fixed;
/* background-color: red; */
}
#top{
position:fixed;
/*
margin:0px;
*/
top:0px;
left:80px;
right:80px;
*/
text-align: center;
height: 80px;
background-color: magenta;
}
<!DOCTYPE html>
<html>
<head>
<!-- <link rel="stylesheet" type="text/css" href="css/960_12_col_rtl.css"> -->
<link href="css/custom.css" type="text/css" rel="stylesheet">
</head>
\t <body>
\t <div id="top" class="grid_12"> <h1>THIS IS TOP</h1></div>
\t <div class="container_12 clearfix">
\t \t <div id="header" class="grid_12">
\t \t \t <h1>HUHUHUHU</h1>
\t \t </div>
\t \t <div id="comment1" class="grid_3">
\t \t \t <p>This is comment 1!</p>
\t \t </div>
\t \t <div id="comment2" class="grid_3">
\t \t \t <p>This is comment 2!</p>
\t \t </div>
\t \t <div id="comment3" class="grid_3">
\t \t \t <p>This is comment 3!</p>
\t \t </div>
\t \t <div id="comment4" class="grid_3">
\t \t \t <p>This is comment 4!</p>
\t \t </div>
\t
\t \t <div class="grid_4 image" >
\t \t \t <p id="image1">image1</p>
\t \t </div> \t \t
\t \t <div class="grid_4 image">
\t \t \t <p id="image2">image2</p>
\t \t </div>
\t \t <div class="grid_4 image">
\t \t \t <p id="image3">image3</p>
\t \t </div>
\t \t
\t \t
\t \t <div id="underLeftImage" class="grid_4 text">
\t \t \t <p id="underLeftImageText">image3</p>
\t \t </div>
\t \t \t \t
\t \t <div id="underCenterImage" class="grid_4 text">
\t \t \t <p id="underCenterImageText">image3</p>
\t \t </div> \t \t
\t \t <div id="underRightImage" class="grid_4 text">
\t \t \t <p id="underRightImageText">image3</p>
\t \t </div>
\t </div>
\t </body>
</html>
嗯..你能告訴我們你是怎麼做到的嗎?一些代碼,以便我們可以找到在哪裏幫助你? – Sinstein
當然,我把它添加到問題。我是htmland css的新手。網頁設計師是否使用在線工具分享代碼?用代碼附上鍊接會更乾淨。 – brumbrum
是的。請參閱https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/。 – Sinstein