단일 페이지 웹 사이트를 만들려고하는데 기본 레이아웃을 정렬하는 데 문제가 있습니다. 내가 원하는 것은 사용자가 브라우저 창을 채우는 첫 번째 div (예 : http://whiteboard.is)를 차지하는 사이트를 방문 할 때입니다. 그 후 두 번째 div는 고정 된 위치이지만 수동으로 높이를 설정하여 콘텐츠를 추가 할 수 있습니다.고쳐 배경 크기 : 커버; 문제
배경 크기 태그를 사용해 보았지만 어떤 이유로 수평으로 만 고정됩니다. 수직적으로 단지 min-height : value로 설정됩니다.
왜 그런가? 이 컨테이너의 크기를 증가하지 않도록
HTML
<body>
<section id="first" class="clearfix">
<div class="scanlines"></div>
</section>
<section id="second" class="clearfix">
<div class="scanlines"></div>
</section>
</body>
CSS
#first {
background: url(1.jpg) no-repeat center center;
background-attachment: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
min-width: 1024px;
min-height: 768px;
}
#second {
background: url(3.jpg) center no-repeat fixed;
position: relative;
height: 8000px;
width: 100%;
}
.scanlines {
background: url(scanlines.png);
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
z-index: 25;
}
: / –