我正在嘗試使用背景圖像屬性。我真的很困惑重複x和y。我試圖弄清楚它的功能,並且發現我發現的在線事物不夠好。我創建了兩列,左欄將獲得63%,右欄37%(近似)。我使用了寬度爲3000px,高度爲160的背景圖像,併爲兩列使用了兩種不同的顏色。也就是說,在1890px或63%之後,顏色會發生變化。背景img重複x和Y
我使用我的筆記本電腦與1350px寬屏幕。我不斷改變repeat-y的比例,看看它在做什麼。我仍然無法弄清楚,發生了什麼事。這是我的理解,如果我錯了,請給我更簡單的解釋。對我來說,如果我設置重複44%,那麼它會佔用當前容器的44%,比如說Z PX,並且從z PX開始到圖像的結尾設置背景圖像,在我的情況下爲3000px,垂直重複該過程。我希望我很清楚。我對麼?請讓我知道你的想法或以你自己的方式向我解釋。謝謝!
#page{
background:url("bg.jpg") repeat-y 63%;
}
.clear{
clear:both;
}
div.left{
width:63.11111111%;
float:left;
}
div.right{
float:right;
width:36%;
}
}
</style>
</head>
<body>
<div id="page">
<div class="left">
this is left column
</div>
<div class="right">
this is right column
</div>
<div class="clear"></div>
</div>
</body>
閱讀文檔:https://developer.mozilla.org/en-US/docs/Web/CSS/background –
在線代碼:嘗試http://jsfiddle.net/ –