백그라운드 풀스크린 이미지 적용하기
<!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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 72 | 9년 전 | 4601 | ||
| 71 |
|
9년 전 | 3959 | |
| 70 | 9년 전 | 5020 | ||
| 69 | 9년 전 | 3803 | ||
| 68 | 9년 전 | 3757 | ||
| 67 | 9년 전 | 3608 | ||
| 66 | 9년 전 | 4458 | ||
| 65 | 9년 전 | 3798 | ||
| 64 | 9년 전 | 5167 | ||
| 63 | 9년 전 | 3328 | ||
| 62 | 9년 전 | 2860 | ||
| 61 | 9년 전 | 3225 | ||
| 60 | 9년 전 | 4167 | ||
| 59 | 9년 전 | 4025 | ||
| 58 | 9년 전 | 4448 | ||
| 57 |
씨에이치넷
|
9년 전 | 6515 | |
| 56 |
|
10년 전 | 4349 | |
| 55 |
|
10년 전 | 4878 | |
| 54 |
|
10년 전 | 3750 | |
| 53 |
씨에이치넷
|
10년 전 | 4912 | |
| 52 | 10년 전 | 3763 | ||
| 51 |
프로그램은어려워
|
10년 전 | 4821 | |
| 50 |
잘살아보자
|
10년 전 | 3441 | |
| 49 |
잘살아보자
|
10년 전 | 3643 | |
| 48 |
잘살아보자
|
10년 전 | 4767 | |
| 47 | 10년 전 | 5807 | ||
| 46 | 10년 전 | 8251 | ||
| 45 |
|
10년 전 | 5341 | |
| 44 |
|
10년 전 | 3969 | |
| 43 | 10년 전 | 3980 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기