2017-10-12 4 views
0

내 페이지 하단에 높이가 고정되어있는 바닥 글이 있습니다. 내 페이지의 내용을 고정 바닥 글의 맨 위에서 끝내도록 스크롤 할 수 있습니까?고정 위치 요소 뒤로 스크롤하지 못함

여기 내 문제의 바이올린 : fiddle

마지막 250 픽셀 (바닥 글 높이) 비 고정 요소의 바닥 글 뒤에 스크롤 스크롤은 페이지의 바닥을 칠 때 볼 수 없습니다.

<div style="height: 500px; width: 50%; background-color: yellow;"></div> 
<div style="height: 500px; width: 50%; background-color: blue;"></div> 
<div style="height: 500px; width: 50%; background-color: green;"></div> 

<div style="position: fixed; width: 100%; height: 250px; bottom: 0; background-color: #ccc;"> 
    Fixed Footer 
</div> 

답변

1

에 250 픽셀의 여백 바닥을 추가하고 별도로 대신 CSS를 작성하는 경우 좋은 것 div에 스타일 속성을주는 것. 당신의 문제를 해결하기 위해

우리는 이러한 속성 here.

body, 
 
html{ 
 
    overflow: hidden; 
 
    margin: 0; 
 
    padding: 0; 
 
    }
<div style="height: 500px; width: 50%; background-color: yellow;"></div> 
 
<div style="height: 500px; width: 50%; background-color: blue;"></div> 
 
<div style="height: 500px; width: 50%; background-color: green;"></div> 
 

 
<div style="position: fixed; width: 100%; height: 250px; bottom: 0; background-color: #ccc;"> 
 
    Fixed Footer 
 
</div>

+0

그냥 외부 스타일을 제공하는 대신 내 문제의 예제로 사용했습니다. 도움을 주셔서 감사합니다. – noclist

+0

@noclist, 그 멋진 !! 환영 –

1

그러나 당신이 CSS를 작성해야, 이것은 당신이 할 필요가 뭔가 마지막 DIV

<div style="height: 500px; width: 50%; background-color: green; margin-bottom:250px;"> 
</div> 
+0

좋은 생각, 감사에 대해 자세히 알아 숨길 수 오버 플로우를 설정해야합니다! – noclist

관련 문제