는 또한 여러 개의 배경 이미지를 사용할 수 있습니다. 이 예제에서는 배경 왼쪽, 센터의 이미지와 잘 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-position
의 세 background-repeat
의 세 background-image
의를 사용하고 있습니다.
이미지는 역순으로 렌더링됩니다. 예를 들어 왼쪽과 오른쪽 이미지가 가운데 이미지 위에 그려집니다.
여러 배경 이미지 (CSS 3) 또는 생성 된 콘텐츠. – CBroe