html 页面重复度高,html – CSS背景渐变重复问题
我有一個需要擴展寬度和高度的html頁面,所以需要能夠上下左右滾動,但是我似乎無法使css漸變重復-x并向下留下純色.
剝離代碼:
/p>
"http://www.w3.org/TR/html4/loose.dtd">
html {
height: 100%;
background-color: #366fcd; }
body {
margin: 0;
height: 100%;
width: 100%;
background-color: #366fcd;
background: -moz-linear-gradient(center top, #316494 0%,#366fcd 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #316494),color-stop(1, #366fcd));
background-repeat: repeat-x;
}
div#TheElement {
position: absolute;
width: 100px;
height: 100px;
background-color: #fff;
left: 2000px;
top: 2000px;
}
當您向下滾動時,這會將漸變運行為純色(#366fcd),但是當您向右滾動時,漸變會停止,您也會看到純色. See example.
如果我刪除背景顏色:#366fcd;從html元素開始,然后漸變沿著x軸重復,但是當你向下滾動時,漸變停止并出現白色. See example.
我知道我總是可以使用背景圖像,但更喜歡讓CSS工作.
哦,是的,這是在OSX Lion的Chrome和FF上測試的.
安東尼
總結
以上是生活随笔為你收集整理的html 页面重复度高,html – CSS背景渐变重复问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 最大值_Leetcode2 | 滑动窗口
- 下一篇: C语言 vprintf 函数 - C语言