2013-09-01 1 views
0

IE8에서 전체 페이지 배경을 얻으려면 어떻게해야합니까? 그것은 파이어 폭스와 크롬에서 잘 작동합니다. 1000px div의 배경을 지정했습니다. 그러나 나는 신체 또는 html의 배경을 지정하는 것에 열려 있습니다. 시간 내 줘서 고마워. 스티븐IE8에서 전체 페이지 배경을 얻으려면 어떻게해야합니까?

<!doctype html> 
<html> 
<style> 
html { 

} 

div.whole{width="1000px";margin:0 auto;border-style:solid; border-width:0px;height:100%;padding:0px; 

background: url(images/parchment.png) no-repeat center center fixed; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 

} 

html, body { 
margin: 0px; 
padding: 0px; 
border: 0px; 
height:100%; 
width:100% 
} 

div.image{position:relative; top:50px;left:900px;width:300px; border-style:solid;border-width:0px;} 



@font-face 
{ 
font-family: myFirstFont; 
src: url(pachs___.ttf); 
} 

div.text{position:relative;left:250px;top:-300px; font-family:myFirstFont; font-size:250%;border-style:solid;border-width:1px; 
width:600px;} 


</style> 

<body> 
<div class="whole"> 

    <div class="image"> 
    <img src="images/tran.png" width="282px" height="381px" class="tran"> 
    </div> 
     </div> 
</body> 
</html> 

답변

0

div.whole는 HTML, body 태그 이하로 할 필요가있다. 첫 번째로 나타나는 요소가 두 번째로 나타나는 요소의 컨테이너 역할을하기 때문에 제대로 구조화하지 않습니다. 이것은 css로 들어가기 위해 필요한 습관입니다. 또한 높이를 지정해야하며 백분율 값을 사용하여 100 %를 커버하는 것이 좋습니다. 1000px를 100 %로 바꾸십시오. html과 body를위한 배경을 원한다면, 그들 자신의 괄호 안에서 지정할 필요가 있습니다.

관련 문제