잘 작동하는 바닥 글이 있지만 페이지의 콘텐츠 크기가 페이지 크기보다 짧으면 바닥 글이 페이지 하단이 아닌 콘텐츠 아래에 렌더링됩니다. 다음은 이미지입니다.
다음은 내 코드 (jsbin 스 니펫)입니다.
.footer {
position: absolute;
width: 100%;
margin-bottom: 0;
background-color: #2D2D2D;
height: 100px;
text-align: center;
color: white;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
</head>
<body ng-app="AngularJSApp">
<div class="contentBody">
<div id="contenido">
@RenderBody()
</div>
</div>
<div class="footer">
<p class="copyright">Copyright © 2015 Diego Unanue — <a href="http://ryanfait.com/" title="3xM Web Design">3xM Web Design</a></p>
</div>
</body>
</html>
이 문제를 해결하고 항상 바닥 글을 페이지 하단에 유지하려면 어떻게해야합니까?
이 고정 바닥 글을 사용할 수 있습니다.
html,
body {
height: 100%;
margin: 0
}
.contentBody {
min-height: 100%;
/* equal to footer height */
margin-bottom: -100px
}
.contentBody:after {
content: "";
display: block
}
.footer,
.contentBody:after {
height: 100px
}
.footer {
width: 100%;
background-color: #2D2D2D;
text-align: center;
color: white
}
<body ng-app="AngularJSApp">
<div class="contentBody">
<div id="contenido">
@RenderBody()
</div>
</div>
<div class="footer">
<p class="copyright">Copyright © 2015 Diego Unanue — <a href="http://ryanfait.com/" title="3xM Web Design">3xM Web Design</a>
</p>
</div>
</body>
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다