2012-06-18 6 views
0

나는 배경 (파란색 그라디언트)을 배치 할 컨테이너 div (outer_most_container)가 있습니다. 스크롤하는 동안 이미지가 고정되어야합니다. 문제는 이미지의 너비가 1040 픽셀이므로 divem의 폭에 맞게 맞춰야하지만 문제는 아닙니다.이미지가 피팅 내부 Div

또한 축소하면 왜 이미지가 사라지는 지 잘 모르겠습니다.

http://i.imgur.com/patgb.png

HTML

<!DOCTYPE HTML> 
<html> 
<head> 
    <title>UnderWater Theme</title> 
    <link rel="stylesheet" href="underwater.css" /> 
</head> 
<body> 
    <div class="outer_most_container"> 
      <div class="top"> 
       <div class="banner">  
       </div> 
      </div> 
    </div> 
</body> 
</html> 

CSS

* { 
    margin: 0; 
    padding: 0; 
} 
html { 
    font-size: 100%; 
    height: 100%; 
} 
body { 
    font-size: 1em; 
    background-color: black; 
    height: 100%;  
} 
.outer_most_container { 
    position: relative; 
    width: 65em; 
    height: 43.75em; 
    margin: auto; 
    background-image: url('Aura.jpg'); 
    background-attachment: fixed; 
    background-repeat: no-repeat; 
    background-color: red; 
} 
+0

내가 사용하는 것이 좋습니다 http ://html5boilerplate.com/ 여기에서 사용하는 일반 선택기 CSS 재설정 대신 멋진 CSS 재설정이 있습니다. –

답변

0

내가 사용하여 축소하는 동안 크기 조정에서 이미지를 방지 할 수 있었다 :

background-size: 65em 43.75em; 
관련 문제