백그라운드 풀스크린 이미지 적용하기
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>제목</title>
<style>
* { margin: 0; padding: 0; }
#bg { position: fixed; top: 0; left: 0; }
.bgwidth { width: 100%; }
.bgheight { height: 100%; }
#page-wrap { position: relative; width: 400px; margin: 50px auto; padding: 20px; background: white; -moz-box-shadow: 0 0 20px black; -webkit-box-shadow: 0 0 20px black; box-shadow: 0 0 20px black; }
p { font: 15px/2 Georgia, Serif; margin: 0 0 30px 0; text-indent: 40px; }
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(function() {
var theWindow = $(window),
$bg = $("#bg"),
aspectRatio = $bg.width() / $bg.height();
function resizeBg() {
if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
$bg
.removeClass()
.addClass('bgheight');
} else {
$bg
.removeClass()
.addClass('bgwidth');
}
}
theWindow.resize(function() {
resizeBg();
}).trigger("resize");
});
</script>
</head>
<body>
<img src="/data/201107/IJ13098874706702/bg.jpg" id="bg" alt="">
<div id="page-wrap">
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
<p>샘플 텍스트</p>
</div>
</body>
</html>
게시판 목록
디자이너팁
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 162 | 6년 전 | 2049 | ||
| 161 | 6년 전 | 1596 | ||
| 160 | 6년 전 | 2246 | ||
| 159 | 6년 전 | 1597 | ||
| 158 | 6년 전 | 1991 | ||
| 157 | 6년 전 | 1378 | ||
| 156 | 6년 전 | 1345 | ||
| 155 |
씨에이치넷
|
6년 전 | 2963 | |
| 154 | 6년 전 | 2632 | ||
| 153 | 6년 전 | 2042 | ||
| 152 | 6년 전 | 2393 | ||
| 151 | 6년 전 | 1770 | ||
| 150 |
찐찐222
|
6년 전 | 2417 | |
| 149 | 7년 전 | 3164 | ||
| 148 | 7년 전 | 2144 | ||
| 147 | 7년 전 | 2427 | ||
| 146 |
루돌프사슴코
|
7년 전 | 4479 | |
| 145 |
|
7년 전 | 3162 | |
| 144 |
|
7년 전 | 2278 | |
| 143 | 7년 전 | 3084 | ||
| 142 | 7년 전 | 3504 | ||
| 141 |
|
7년 전 | 2049 | |
| 140 | 7년 전 | 2453 | ||
| 139 | 7년 전 | 4983 | ||
| 138 |
|
7년 전 | 4875 | |
| 137 |
|
7년 전 | 2584 | |
| 136 |
|
7년 전 | 3318 | |
| 135 | 7년 전 | 2893 | ||
| 134 | 7년 전 | 3792 | ||
| 133 | 7년 전 | 3067 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기