2012-12-05 2 views
-1

Pls 나를 도와주세요. 난 노력 했어.페이지를 스크롤하는 동안 다른 div의 위에 div를 유지하는 방법은 무엇입니까?

이 내 코드 현재

HTML

<div id="header"><!--beggining of header--> 

    </div><!--end of header--> 

CSS

#header { 
    width: auto; 
    height: 100px; 
    background-color: #F0F; 
    border-bottom-style: solid; 
    border-bottom-color: #000; 
    position: fixed; 
    } 

죄송합니다. 이것은 본 STE를 처음 사용하는 것입니다. 나는 코드를 게시 할 수 없습니다. 하지만하는 최대 HTML을 볼 HERE

+0

전체 코드를 게시하시기 바랍니다 :-) –

+0

http://whathaveyoutried.com - HTML도 함께 보내주십시오. – FixMaker

+1

질문이 명확하지 않습니다. 정확하게 당신이 성취하고자하는 것은 무엇이며, 그 문제는 무엇입니까? – RJo

답변

5

확인이 fiddle

HTML은 :

<div class="cover"> 
    top 
    <div class="fixed-box"> 
    hello        
    </div> 
</div> 

CSS :

.fixed-box { 
    width:100px;/*just for preview*/ 
    height:100px;/*just for preview*/ 
    background:red;/*just for preview*/ 
    position:fixed; 
    top:10px; 
} 
.cover { 
    width:500px;/*just for preview*/ 
    height:10000px;/*just for preview*/ 
    background:blue;/*just for preview*/ 
} 
+1

+1. 당신은 스크롤이 더 나은 일이 업데이 트를 볼 수 있습니다 : http://jsfiddle.net/npu3L/1/ – FixMaker

+0

고마워요 모든 하나는 지금 내 대답 – DAViD

0
#header {width: auto; height: 100px; background-color: #F0F; border-bottom-style: solid; 
    border-bottom-color: #000; position: fixed; top:0px; z-index:100;} 

는 헤더 DIV 후 확인하십시오 하나의 컨테이너 DIV을 콘텐츠를 만들고 해당 div를 만듭니다. position:relative; z-index:50;

관련 문제