<!-- feature -->
<section class="section section--feature">
<div class="summary">
<div class="summary__title">
Welcome home, developers
</div>
<div class="summary__description">
GitHub fosters a fast, flexible, and collaborative development process that lets you work on your own or with others.
</div>
</div>
<div class="video">
<div class="video-ratio">
<iframe width="1020" height="574" src="https://www.youtube.com/embed/afvT1c1ii0c" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="tiles">
</div>
</section>
이렇게 구조를 잡아 주었다.
video그냥 넣으면 반응형이 안되기 때문에 div 태그 안에 넣었다.
[html][css] 유튜브 video 16:9 비율에 맞게 삽입하기[html][css] 유튜브 video 16:9 비율에 맞게 삽입하기
.video{ max-width: 650px; border: 4px solid red; } .video-ratio{ height: 0; /* padding top은 부모 요소의 가로 요소에 영향을 받는다 */ /* height는 반응형이 안되고 크기를 픽스해버리는 것임 */ padding-..
sso-feeling.tistory.com
<!-- feature -->
<section class="section section--feature">
<div class="summary">
<div class="summary__title">
Welcome home, developers
</div>
<div class="summary__description">
GitHub fosters a fast, flexible, and collaborative development process that lets you work on your own or with others.
</div>
</div>
<div class="video">
<div class="video-ratio">
<iframe width="1020" height="574" src="https://www.youtube.com/embed/afvT1c1ii0c" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
<div class="tiles">
</div>
</section>
/* feature */
.section--feature{
background: #f5f5f5;
padding-top: 66px;
}
.section--feature .summary{
max-width: 820px;
/* 820안에서는 가변적인 넓이 */
margin: 0 auto;
text-align: center;
}
.section--feature .video{
max-width: 650px;
margin: 50px auto;
}
.section--feature .video .video-ratio{
height: 0;
padding-top: 56.25%;
position: relative;
}
.section--feature .video .video-ratio iframe{
position: absolute;
top:0;
left:0;
width:100%;
height:100%;
}
grid
section--feature .tiles ul{
display: grid;
/* 4개의 column을 만들것이고 1대 비율로 만들것이다 */
grid-template-columns: repeat(4, 1fr);
}
grid는 구형이라서 구형 브라우저는 사용 못한다.
.section--feature .tiles li{
padding: 34px 24px;
text-align: center;
line-height: 1.5;
border-right: 1px solid #e5e5e5;
box-sizing: border-box;
/* grid를 쓰지 않고 요소들을 수평으로 하기위해 */
float: left;
width: 25%;
}
li의 부모 요소인 ul 태그에 clearfix 클래스를 추가해준다
728x90
'무작정 따라하기 > 패스트캠프(프론트)' 카테고리의 다른 글
[깃허브 예제] footer / svg로 로고 넣기 /배치를 바꾸지 않으면서 svg로 이미지 가운데로 배치하기 (0) | 2021.04.22 |
---|---|
[깃허브 예제] 하단 card부분 (0) | 2021.04.22 |
[깃허브 예제] 로 자연스럽게 글자 줄바꾸는 법 / 깃허브 visual section 우측 input박스와 sign up 버튼 만들기 (0) | 2021.04.21 |
[깃허브 예제] 배경이미지 조금 어둡게 만들기/ 화면 축소해도 배경 이미지 안짤리게 만들기 (0) | 2021.04.21 |
[깃허브 예제] 중간부분 visual section만들기 / section의 공통 css정의 (0) | 2021.04.21 |