CSS

(CSS) 배경위에 텍스트가 떠있는 느낌을 표현 가능 : background-attachment:fixed

SAFE 2016. 4. 29. 11:35

background-attachment: fixed; 이걸 쓰면 됩니다.


1
2
3
4
5
6
7
8
9
10
<html>
<head>
<title>고정된 배경이미지 예제</title>
<style type="text/css">
    body { 
        background-image: url(bg.gif); 
        background-attachment: fixed;
        background-repeat: no-repeat
    }
</style>
cs


background-attachment 속성에 fixed값을 사용하여 배경이미지를 고정하면 배경위에 텍스트가 떠있는 느낌을 표현할 수 있습니다.


출처 : http://www.homejjang.com/07/background-attachment.php