您也可以使用多背景圖片。在這個例子中,我設置了左,背景圖像和右眼BG圖片:
h1, h2, h3, h4, h5, h6 {
background-image: url("images/heading-bg-left.png"), url("images/heading-bg-right.png"), url("images/heading-bg-center.png"); /* set each bg image */
background-position: left center, center center, right center; /* set position of each bg image */
background-repeat: no-repeat, no-repeat, repeat-x; /* set repeat of each bg image */
padding: 0 92px; /* 92px is the width of my left and right bg images */
height: 120px; /* 120px is the height of each bg image */
line-height: 120px; /* ditto */
}
的代碼是相當不言自明,但基本上我已經使用了三個background-image
有三個background-position
秒和3 background-repeat
秒。
請注意,圖像呈現的順序相反。因此,在我的示例中,左側和右側圖像將繪製在中央圖像的頂部。
多背景圖像(CSS 3)或生成的內容。 – CBroe