CSS3 background-origin 속성
CSS3 background-origin 속성
CSS3 background-origin속성은 배경 이미지의 위치를 지정합니다.
이 속성에는 세 가지 값이 사용됩니다.
1. border-box - 테두리의 왼쪽 위 모퉁이에서 배경 이미지가 시작됩니다.
2. padding-box - (기본값) 배경 이미지는 패딩 가장자리의 왼쪽 위 모퉁이에서 시작합니다.
3. content-box - 배경 이미지는 콘텐츠의 왼쪽 상단에서 시작합니다.
다음 예제에서는이 background-origin속성을 보여줍니다 .
#example1 {
border: 10px solid black;
padding: 35px;
background: url(img_flwr.gif);
background-repeat: no-repeat;
background-origin: content-box;
}
<!DOCTYPE html>
<html>
<head>
<style>
#example1 {
border: 10px solid black;
padding: 35px;
background: url(img_flwr.gif);
background-repeat: no-repeat;
}
#example2 {
border: 10px solid black;
padding: 35px;
background: url(img_flwr.gif);
background-repeat: no-repeat;
background-origin: border-box;
}
#example3 {
border: 10px solid black;
padding: 35px;
background: url(img_flwr.gif);
background-repeat: no-repeat;
background-origin: content-box;
}
</style>
</head>
<body>
<p>No background-origin (padding-box is default):</p>
<div id="example1">
<h2>Lorem Ipsum Dolor</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
</div>
<p>background-origin: border-box:</p>
<div id="example2">
<h2>Lorem Ipsum Dolor</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
</div>
<p>background-origin: content-box:</p>
<div id="example3">
<h2>Lorem Ipsum Dolor</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>
</div>
</body>
</html>



게시판 목록
퍼블리셔팁
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 1187 | 기타 | 6년 전 | 2273 | ||
| 1186 | 기타 | 6년 전 | 2106 | ||
| 1185 | 기타 | 6년 전 | 2105 | ||
| 1184 | 기타 | 6년 전 | 2114 | ||
| 1183 | 기타 | 6년 전 | 1870 | ||
| 1182 | 기타 | 6년 전 | 2152 | ||
| 1181 | 기타 | 6년 전 | 1737 | ||
| 1180 | 기타 | 6년 전 | 1941 | ||
| 1179 | 기타 | 6년 전 | 2143 | ||
| 1178 | 기타 | 6년 전 | 2231 | ||
| 1177 | 기타 | 6년 전 | 1763 | ||
| 1176 | 기타 | 6년 전 | 1619 | ||
| 1175 | 기타 | 6년 전 | 2090 | ||
| 1174 | 기타 | 6년 전 | 1653 | ||
| 1173 | 기타 | 6년 전 | 1498 | ||
| 1172 | 기타 | 6년 전 | 1682 | ||
| 1171 | 기타 | 6년 전 | 1372 | ||
| 1170 | 기타 | 6년 전 | 1553 | ||
| 1169 | 기타 | 6년 전 | 1286 | ||
| 1168 | 기타 | 6년 전 | 1412 | ||
| 1167 | 기타 | 6년 전 | 1280 | ||
| 1166 | 기타 | 6년 전 | 1598 | ||
| 1165 | 기타 | 6년 전 | 1341 | ||
| 1164 | 기타 | 6년 전 | 1657 | ||
| 1163 | 기타 | 6년 전 | 1626 | ||
| 1162 | 기타 | 6년 전 | 1585 | ||
| 1161 | 기타 | 6년 전 | 3421 | ||
| 1160 | 기타 | 6년 전 | 3097 | ||
| 1159 | 기타 | 6년 전 | 2209 | ||
| 1158 | 기타 | 6년 전 | 1901 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기