2014-07-14 1 views
0

이것은 내 코드입니다. #splash의 배경이 페이지의 90 %가되고 싶습니다.학부모와 함께 근무하지 않는 div 비율

<html> 

<body> 
    <div id="splash"> 
     hi 
    </div> 
</body> 
</html> 

http://jsfiddle.net/L6KGk/

a, span, p, h1, h2, h3, h4, h5, h6, body { 
    margin: 0; 
    padding: 0; 
    outline: none; 
    left: 0; 
    right: 0; 
    top: 0; 
    bottom: 0; 
} 
a, a:focus, a:hover, a:active{ 
    text-decoration: none; 
    color: inherit; 
    cursor: pointer; 
} 
p, h1, h2, h3, h4, h5, h6{ 
    font-family: 'Open Sans', Helvetica, Arial, sans-serif; 
} 
body{ 
    overflow-y: scroll; 
    overflow-x: hidden; 
    background-image: white; 
    height: 100%; 
    width: 100%; 
} 
.inner{ 
    width: 85%; 
    position: relative; 
    margin: auto; 
} 
#splash{ 
    height: 90%; 
    background-color: red; 
    width: 100%; 
    position: relative; 
} 

및 HTML 나는 그것으로보고 부모 body뿐만 아니라 100 %해야한다고 보았다. 그래도 아직 작동하지 않아서 모르겠습니다.

답변 해 주셔서 감사합니다.

답변

2

은 그냥 CSS에서 몸 전에 'HTML'요소를 추가, 그것은 ;-)

html, body { 
0

이 시도 작동합니다

#splash{ 
    height: 90%; 
    background-color: red; 
    width: 100%; 
    position: absolute; 
} 
관련 문제