2012-10-30 7 views
1

위에 나는 acheive하려는 위치의 컨텐츠를 배치하는 방법 : 속성은 다음과 같습니다 enter image description here머리글과 바닥 글

: 그래서

.header, .footer { 
    background: #666; 
    height: 100px; 
} 

.content { 
    background: #ccc; 
    margin: -25px auto; 
    min-height: 500px; 
    width: 960px; 
} 

이제 enter image description here

을 나는 다음과 같은 한을 내용이 꼬리말 아래에 놓여 있고 그것을 고치는 법을 모른다는 문제. Z- 색인이 작동하지 않습니다.

내 HTML :

<div class="header"></div> 
<div class="content"></div> 
<div class="footer"></div> 

답변

4

는이

.header, .footer { 
    background: #666; 
    height: 100px; 
    position: relative; 
    z-index: 1; 
} 

.content { 
    background: #ccc; 
    margin: -25px auto; 
    min-height: 500px; 
    width: 960px; 
    position: relative; 
    z-index: 100; 
} 
+0

덕분에, 작품을, 병 5 분의 답변을 받아 – UAMoto

관련 문제