4
두 페이지로 나누어 져 있습니다. 왼쪽은 행 컨테이너에 내용이 있고 나머지 절반은 컨테이너 외부로 나가는 이미지입니다. 이 섹션에는 그라디언트 BG가있어서 노트북이 선반 위에 앉아있는 효과를줍니다.섹션 크기가있는 배경 배율의 CSS 그라디언트
(https://monosnap.com/file/fX2jGJ9HcEuw6xsSFK8TzbdO023RMd를)
목표을 : 여기에 내가 달성하기 위해 노력하고있어의 스크린 샷이다
- 이미지가 뷰포트의 50 %를 차지하고있는 권리를 만지지 되세요 측면 화면이 입니다. 콘텐츠가 콘텐츠 컨테이너 (행)에 남아 있어야합니다.
- 그라디언트는 스크린 샷에 표시된 위치에 있습니다.
- 섹션은 크기가 조정되면 높이에 따라 응답합니다.
HTML는 : 콘텐츠가 따라 장소에 남아 있도록
<section class="full-width snocruapp-offtheslopes tgs-section-titles half-and-half-section hide-for-small-only">
<div class="row">
<div class="large-6 medium-6 columns">
<div class="copy--with-image copy--align-left">
<div class="tgs-section-titles"><h3>Off the Slopes Counterpart</h3>
<hr>
<p>One important piece of the user experience was that the website functioned more than just a marketing tool. We developed the dashboard area so when users logged in, they were provided with personalized data, leaderboard stats and track heat mapping.</p>
</div>
</div>
</div><!--end large 6 right -->
<div class="large-6 medium-6 columns"></div>
<div class="image--align-to-window image--align-right">
<picture>
<source srcset="http://sandbox.techgrayscale.com/wp-content/uploads/2016/03/slopes-image2.png" media="(min-width: 1024px)">
<img srcset="http://sandbox.techgrayscale.com/wp-content/uploads/2016/03/sno_mbl_counterpart_nograd.png" alt="Half Image">
</picture>
</div>
</div><!--end row -->
</section>
나는 내용으로 재단 그리드를 만들었습니다. 다음으로 이미지 div를 만들고 나머지 절반 위에 배치하도록 이미지를 배치했습니다.
CSS는 :
* {
margin: 0;
padding:0;
}
section {
display: block;
overflow: hidden;
}
.full-width {
width: 100%;
margin-left: auto;
margin-right: auto;
max-width: initial;
}
.half-and-half-section {
position: relative;
margin: 50px 0;
}
.half-and-half-section .image--align-to-window {
position: absolute;
top: 0;
}
.half-and-half-section .image--align-right {
right: 0;
width: 50%;
}
.snocruapp-offtheslopes {
background: #ffffff;
background: linear-gradient(to bottom, #ffffff 0%, #e2e2e2 75%, #ffffff 75%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ffffff',GradientType=0);
}
나는 부분에 CSS 구배를 적용했다. 이미지는 절대적으로 positined하므로 컨테이너의 일부가 아니며 뷰포트의 오른쪽으로 확장 될 수 있습니다.
몇 가지 문제가 있습니다.
- 섹션에 패딩을 추가하지 않으면 이미지가 잘립니다.
- 뷰포트의 크기를 조정할 때 그래디언트를 동일한 위치에 유지하는 방법 (이미지 크기에 비례하여 크기 조정)을 얻는 방법을 모르겠습니다.
저는 스크린 샷에서 기능과 디자인을 얻는 방법을 실제로 잃어 버렸습니다.
codepen 링크를 업데이트 하시겠습니까? 404 – actimel