CSS3 background-clip 속성
CSS3 background-clip 속성
CSS3 background-clip속성은 배경의 그림 영역을 지정합니다.
이 속성에는 세 가지 값이 사용됩니다.
1. border-box - (기본값) 배경이 테두리의 바깥 가장자리에 칠해집니다.
2. padding-box - 배경이 채우기 바깥 쪽 가장자리에 칠해집니다.
3. content-box - 배경이 내용 상자 안에 그려진다.
다음 예제에서는이 background-clip속성을 보여줍니다 .
예
#example1 {
border: 10px dotted black;
padding: 35px;
background: yellow;
background-clip: content-box;
}
전체소스
<!DOCTYPE html>
<html>
<head>
<style>
#example1 {
border: 10px dotted black;
padding:35px;
background: yellow;
}
#example2 {
border: 10px dotted black;
padding:35px;
background: yellow;
background-clip: padding-box;
}
#example3 {
border: 10px dotted black;
padding:35px;
background: yellow;
background-clip: content-box;
}
</style>
</head>
<body>
<p>No background-clip (border-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>
</div>
<p>background-clip: padding-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>
</div>
<p>background-clip: 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>
</div>
</body>
</html>


게시판 목록
퍼블리셔팁
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 1037 | CSS | 8년 전 | 1857 | ||
| 1036 | CSS | 8년 전 | 1173 | ||
| 1035 | CSS | 8년 전 | 1382 | ||
| 1034 | CSS | 8년 전 | 1360 | ||
| 1033 | CSS | 8년 전 | 1576 | ||
| 1032 | CSS | 8년 전 | 1871 | ||
| 1031 | CSS | 8년 전 | 2154 | ||
| 1030 | CSS | 8년 전 | 1809 | ||
| 1029 | CSS | 8년 전 | 1812 | ||
| 1028 | CSS | 8년 전 | 1693 | ||
| 1027 | CSS | 8년 전 | 1483 | ||
| 1026 | CSS | 8년 전 | 1446 | ||
| 1025 | CSS | 8년 전 | 1664 | ||
| 1024 | CSS | 8년 전 | 1699 | ||
| 1023 | CSS | 8년 전 | 1539 | ||
| 1022 | CSS | 8년 전 | 1456 | ||
| 1021 | CSS | 8년 전 | 2106 | ||
| 1020 | CSS | 8년 전 | 2183 | ||
| 1019 | CSS | 8년 전 | 1583 | ||
| 1018 | CSS | 8년 전 | 2077 | ||
| 1017 | CSS | 8년 전 | 1863 | ||
| 1016 | CSS | 8년 전 | 1763 | ||
| 1015 | CSS | 8년 전 | 2210 | ||
| 1014 | CSS | 8년 전 | 1769 | ||
| 1013 | CSS | 8년 전 | 2002 | ||
| 1012 | CSS | 8년 전 | 2302 | ||
| 1011 | CSS | 8년 전 | 2250 | ||
| 1010 | CSS | 8년 전 | 1638 | ||
| 1009 | CSS | 8년 전 | 1538 | ||
| 1008 | CSS | 8년 전 | 1842 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기