2010-04-02 5 views
1

페이지를 아래로 스크롤 할 때와 관계없이 머리글 DIV와 바닥 글 DIV 이 항상으로 표시되고 싶습니다.CSS/HTML : CSS로 IFRAME을 시뮬레이트하는 방법은 무엇입니까?

어떻게 예를 들어

(IFRAMES없이)이 사용하는 경우에만 CSS를 달성 할 : 당신이 IE 6을 피할 수 있다면 당신은 position: fixed을 사용할 수 있습니다

<div id=header>Always display on top, regardless if you have scrolled down the page</div> 
<div id=main_content>...</div> 
<div id=footer>Always display on the bottom</div> 

답변

1

.

뭔가

<style type="text/css"> 
    #header { position: fixed; top: 0px; } 
    #main_content { height: 1200px; } 
    #footer { position: fixed; bottom: 0px; } 
</style> 
<div id=header> 
    Always display on top, regardless if you have scrolled down the page 
</div> 
<div id=main_content>...</div> 
<div id=footer> 
    Always display on the bottom 
</div> 

처럼 A Better Fixed Positioning for Internet Explorer 6

+0

머리글의 경우 'top : 0;'및 바닥 글의 경우 'bottom : 0;'과 함께 사용됩니다. –

0
#header { position: fixed; } 
#footer { position: fixed; } 

를 참조하지만이를 사용하지 마십시오. 사용자는 귀하를 미워하고 사이트를 떠납니다.

0
#header{ 
left:0; 
top:0; 
height:100px; 
width:100%; 
position:fixed; 
z-index:2; 
background:grey; 
} 
#main_content{ 
margin-top:100px; 
margin-bottom:100px; 
height:1000px; 
} 
#footer{ 
bottom:0; 
left:0; 
height:100px; 
width:100%; 
position:fixed; 
z-index:2; 
background:grey; 
} 
관련 문제