0. CSS 실습2 :
- 인스타그램 로그인 페이지 실습 다시 :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="css/login.css" type="text/css" rel="stylesheet">
</head>
<body>
<section class="login-form">
<form>
<fieldset>
<h1>instagram</h1>
<input type="text" placeholder="전화번호, 사용자 이름 또는 이메일">
<input type="text" placeholder="비밀번호">
<button class="submit-form" type="button">
로그인
</button>
<br><br>
<div>⎯⎯⎯⎯ 또는 ⎯⎯⎯⎯</div>
<br>
<div>
<a href="">Facebook으로 로그인</a>
</div>
<div>
<a href="">비밀번호를 잊으셨나요?</a>
</div>
</fieldset>
</form>
</section>
<div class="no-account-form">
<h5>계정이 없으신가요? <a href="">가입하기</a></h5>
</div>
<h5>앱을 다운로드하세요.</a>
<div>
<img src="" alt="App Store에서 다운로드 하기">
<img src="" alt="다운로드하기 Google Play">
</div>
</body>
<footer>
<div class="footer-form">
<div class="footer">
<a href="">Meta</a>
<a href="">소개</a>
<a href="">블로그 </a>
<a href="">채용 정보</a>
<a href="">도움말</a>
<a href="">API</a>
<a href="">개인정보처리방침</a>
<a href="">약관</a>
<a href="">인기 계정</a>
<a href="">위치</a>
<a href="">Instagram Life</a>
<a href="">연락처 업로드 & 비사용자</a>
</div>
<form>
<select name="">
<option value="none">한국어</option>
<option value="none">중국어</option>
<option value="none">일본어</option>
<option value="none">영어</option>
</select>
© 2023 Instagram from Meta
</form>
</div>
</footer>
</html>
- style.css
body{
/* 마진은 항상 탑에 줄 것(나중에 계속 위로부터 밀리기 때문이다) */
margin-top: 150px;
}
- login.css
@import url(style.css);
/* width, height 값 조절은 노가다이다.*/
.login-form{
/*꼭 width 폭을 지정해줘야 합니다. 왜? 해보면 알게 될것입니다.
block 요소의 폭을 지정하지 않으면 부모 요소 너비값의 100%를 상속받기 때문입니다.
*/
width: 231px;
margin-left:auto;
margin-right:auto;
text-align: center;
}
.submit-form{
margin: 10px 0 0 0;
border: 2px solid;
border-radius: 5px;
background-color:#818487;
color: white;
width: 200px;
height: 30px;
}
.submit-form:hover{
margin: 10px 0 0 0;
border: 2px solid;
border-radius: 5px;
background-color:#5fadf7;
color: white;
width: 200px;
height: 30px;
/* hover와 cursor 설정같이 쓰면, 커서 올려 놓을때, 색깔이 바뀐다.. */
cursor: pointer;
}
.no-account-form{
/* 마진을 auto로 주면 폼이던 섹션이던 반응형으로 가운데 정렬된다.(div도) */
margin: auto;
border: 2px solid rgb(179, 162, 162);
width : 225px;
height: 50px;
text-align: center;
line-height: 10px;
}
.footer-form{
display: inline-center;
margin : 100px 0 0 0;
text-align: center;
}
h5{
text-align: center;
}
/* a 태그에 밑줄 없애주기 */
a{
text-decoration: none;
}
/* 이거 안 먹히네 아래 a태그 검은색으로 바꾸기? */
footer>div>div[class="footer"]{
color: #000;
text-decoration: none;
}
/* Input 태그도 스타일링해주기! */
input{
border-color: aliceblue;
border-radius: 5px;
}
1. CSS : display-position 강의
50강) Layout 스타일
1) 블록 조립을 위한 배치(Layout) 방식 :
- block layout, inline layout, table layout, floats layout, positioned layout, flex/ grid layout
2) 레이아웃에 영향을 주는 속성 :
- 수동 모드 : absolute, relative, fixed, sticky
- 자동 모드(position: static = display) : block, inline, table, listitem, none, contents, flex, grid
3) display 속성에 따른 자동 레이아웃 모양 :
- 요즘에는 모바일 환경때문에 많이 쓰인다.
- flex와 grid에 주목해서 사용하자. 옵션이 굉장히 많다.(css 3.0에서 등장)
- block(컨텐트가 수직방향으로 꽂힌다.), inline(컨텐트가 수평방향으로 꽂힌다.)
- table(컨텐트가 표 모양으로 꽂힌다. 행과 열), listitem(목록 모양으로 컨텐트가 꽂힌다. 앞에 목록을 나타내는 .이 존재)
- flex(자동으로 배치해줌.), grid(자동으로 배치해줌.)
4) 레이아웃과 display의 관계 :
- display 블럭 개념 :
- 콘텐츠를 감싸는
inline 블록
: 버튼이나 span, a 태그나 그런 것들을 말한다. 컨텐트 입장에서는 가장 밖의 블럭으로서, 컨텐트를 감싸는 블럭이다. - 콘텐츠 블록을 감싸는
outside 블록
: 콘텐트 블럭과 제목을 합쳐서 만든 더 큰 블럭이다. - 콘텐츠 블록을 감싸는
inside 블록
: 안쪽에서 제목이나 컨텐트를 감싸는 inline 블럭의 최종 말단에 있는 블럭이지만, 안쪽에서는 그나마 밖에 있는 블럭 - Inside 블록 안쪽에서 콘텐츠를 감싸는
internal 블록
: inside 블럭을 보면, 테이블 태그일때는, tbody나 td, tr을 의미한다. ul 태그 일때는 liitem 태그를 의미한다.
- 콘텐츠를 감싸는
- 정리! :
- 정리1 : 보통, 콘텐츠 블럭이라고 부른 애들이 inside 블럭이다. inside 블럭과 제목까지 묶은 section 태그나 div 태그가 outside 블럭이다.
- 정리2 : inline 블럭은 보통 콘텐트 입장에서 버튼이나 a태그 같은 것은 박스에서 가장 밖의 블럭이다. 이러한 것을 inline계라고 부르는데 가장 안쪽 블럭(컨텐트)의 입장에서는 outside 블럭이다.
- display 블럭 종류 :
- outside 블럭 : contents, none, block, inline
- inside 블럭 : table, list-item, flex, grid, ruby
- internal 블럭 : table, table-cell, table-cell
5) 영역의 크기가 고정일 경우에 배치(Layout) 방법 :
position :absolute
를 이용한다.
51강) position 속성1 :
position : absolute
: 절대 위치- left, top 속성으로 버튼의 위치를 이동시킬 수 있다.
- absolute 같은 경우는 위치의 시작이 root 위치부터 시작한다. 즉, (0,0)부터 버튼의 위치가 시작된다.
position : relative
: 상대 위치- relative는 absolute와 다르게 부모 박스로부터 영향을 받아 버튼 위치의 시작을 지정하게 된다.
- 예를 들어, 부모 박스가 (100,100)의 영역을 차지하고 있고, 자식 박스의 위치를
position : relative
로 설정하면, 자식 박스는 (0,100)의 위치에서부터 그려지기 시작한다.
position : fixed
: 버튼이 화면에 붙어 있다.- 화면에 스크롤을 이동해도 계속해서 그 버튼이 고정되어 따라 다닌다.
- 모바일에서는 바로가기, 광고 같은 것에 사용한다. 가끔 헤더같은 것이 붙어 있는 경우에 사용한다.
- 그 이외의 position : sticky(네비게이션 바가 고정되어 이동하여도 계속 따라 다니는 경우)
52강) position 속성2 :
1) position : sticky
:
- 네비게이션 바가 고정되어 이동하여도 계속 따라 다니는 경우,
- fixed와 차이점은 sticky는 스크롤할 때, 일반 문서의 흐름에 따라 움직인다. 그리고 상위 요소, 혹은 하위 요소에 가면 딱 달라 붙는다. 그럴 경우 언제나 화면에 남아 있는다.
- 또한, sticky는 자기 영역이 존재하고 스크롤하여 그 영역이 사라지면 같이 사라진다. 이게 일반 문서의 흐름을 따라 움직인다는 의미이다.
2) position : fixed
:
- 그러나 fixed는 이러한 문서 흐름을 무시하고 독불장군처럼 언제나 화면에 존재한다.
3) position : sticky
, position : fixed
정리 :
- 전영역에 네비게이션바로 이용하고자 할 때, sticky를 이용하고자 하면, body 박스 안에 div태그에 sticky를 붙이는 것이 아니라 body 태그에 붙여줘야 한다. 이렇게 하지 않을 거면 fixed로 이용하자!
4) 실습 코드 :
- relative :
// .rland-location 위주로 볼 것!
.rland{
height: 530px;
overflow: scroll;
color: white;
background: url(../images/2.jpg);
}
.rland-location{
position : relative;
left: 100px;
top: 100px;
}
- absolute :
- 하지만, fixed일 경우, 해당 영역의 박스에서 버튼을 right 끝에 위치하게 한다면, 화면의 크기를 늘리면 버튼이 스크롤에 붙어서 화면에 따라 같이 움직인다.
// .rland-location 위주로 볼 것!
.rland{
height: 530px;
overflow: scroll;
color: white;
background: url(../images/2.jpg);
}
.rland-location{
position : absolute; // fixed
left: 0px; // right: 0px;
bottom: 0px;
}
5) positioning이 자동에서 수동 설정으로 바뀌는 경우
- 내 부모가 relative이면, 그 안의 자식이 absolute 일 경우 :
- 그 자식의 absolute는 문서 전체에서 absolute가 되는 것이 아니라 부모 중에서 relative가 되어 있는 박스를 기준으로 absolute가 된다.
- positioning이 수동으로 바뀌면(전체가 relative인데 그 자식 부분만 absolute로 변경) 자동 위치에서 빠지게 된다. 겹치더라도 그 위치로 이동한다. 강제성이 생긴다!
.cafe{
height: 480px;
position: relative;
}
.cafe-title{
position: absolute;
left: -14px;
top: 23px;
}
- header에 메뉴 사진을 넣어주면, positioning이 자동에서 수동으로 바뀌기 때문에 높이뿐만 아니라 추가적으로 너비도 설정해주어야 한다.
- 이 예제는 ‘부안에 오면’이라는 박스빼고 나머지를 주석처리하고 헤더 정보만 살린다.
- 기존에 이미지로 만들어 놓은 메뉴 버튼의 태그를 가져온다.(img-btn-menu)
- index.html
<header class="header">
<h1 class="header-title">알랜드</h1>
<div class="img-btn-menu">메뉴버튼</div>
</header>
- index.css
.header{
width: 100% // 퍼센트도 중요하다! 부모의 값을 그대로 받으려고! px이 아니다.
height: 50px;
background-color: #0002;
/* layout */
position: fixed;
top: 0px;
}
2. CSS : display-flex 강의
53강) Flex Layout
- Flex 기본 용어 :
- flex contatiner : 플렉스 박스라고도 불린다. 플렉스 박스 내부에 들어오면 기존의 성질을 없애버린다. 블럭이라지 인라인의 성질을 모두 지워버린다.
- flex item : 플렉스 박스안의 컨텐트를 flex item이라고 부른다.
- flex로 설정하면 내부에는 자식까지만 영향을 주고 자식의 자식까지는 영향을 주지 못한다.
- 따라서,
display: flex(=block-flex)
ordisplay : inline-flex
라고 사용한다. display: flex
이렇게 가장 많이 사용한다.
- Flex Lines : 줄세우기
- flex-direction : 메인 방향 설정
- flex-wrap : 컨텐트가 넘어가면 다음 줄로 넘어가게 해줌.
- flex-flow : ?
- Flexibility : 크기 지정하기(박스 크기의 반응형)
- flex
- flex-grow : 박스 내부에서 설정된 크기 이외의 남은 여백을 같은 비율로 나눠 갖는다. (1로 설정할 경우)
- flex-shrink : 반응형으로 창의 크기를 늘리고 줄어들일 때, 해당 박스의 크기가 같이 줄어 들지 않는다.(0로 설정할 경우)
- flex-basis : 기본 크기?
- Ordering : 순서 바꾸기(박스의 순서 변경)
- order :
- Alignment : 정렬하기(박스의 정렬 변경)
- justify-content : 메인 축 정렬
- align-items : 메인 방향이외의 크로스 축 정렬
- align-self : 오직 하나의 컨텐트를 컨트롤 가능?
54강) Flex Lines, Flexibilty
1) Flex Lines
- Flex Lines 설정
- flex-direction : 메인 방향 설정
- flex-wrap : 아이템 수가 많아져서 아이템이 뷰에서 짤리면 다음 줄로 넘어가게 해줌.
- flex-flow : flex-flow는 flex-direction과 flex-wrap 설정을 같이 쓸 수 있다.
- 실습 코드 :
<body>
<hr>
<section>
<div class="flex-box">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
</section>
<hr>
</body>
.flex-box{
background-color: gray;
display: flex;
flex-direction: row-reverse; // 메인 축이 가로
// flex-direction: column; // 메인 축이 세로
flex-wrap : wrap; // 다음줄로 아이템이 이동 // 'nowrap'은 기본 설정
// flex-wrap : wrap-reverse; // 밀어내는 방식도 조정 가능!
}
.item{
color: white;
background-color: red;
}
.item:nth-child(2n){
background-color: blue;
}
2) Flexibilty
- Flexibilty 기본 설정 :
- flex-grow : 박스 내부에서 설정된 아이템 크기 이외의 남은 여백을 같은 비율로 나눠 갖는다. (1로 설정할 경우)
- flex-shrink : 반응형으로 창의 크기를 늘리고 줄어들일 때, 해당 박스의 크기가 같이 줄어 들지 않는다.(1로 설정할 경우)
- flex-basis : 기본 크기?
- flex-grow 설정
- flex-grow는 한가지 아이템이 여러 여백을 갖게 할 수 있다.
.flex-box{
background-color: gray;
display: flex;
flex-wrap : wrap;
}
.item{
color: white;
background-color: red;
}
.item:nth-child(2){
flex-grow: 1;
}
.item:nth-child(5){
flex-grow: 3;
}
.item:nth-child(2n){
background-color: blue;
}
- flex에서 min-width, max-width의 의미 :
- flex를 사용하고나서 반응형으로 회면이 줄어들거나 늘어나는데 아이템의 크기를 고정시켜주는 것에 대한 설정할 수 있다.
- 이렇게 설정할 경우에는 flex-grow 설정은 없애야 한다. flex-grow는 여백을 나눠 갖기 때문에 원하는 모양대로 나오지 않는다.
.flex-box{
background-color: gray;
display: flex;
flex-wrap : wrap;
}
.item{
color: white;
background-color: red;
}
.item:nth-child(2){
max-width: 30px;
}
.item:nth-child(5){
}
.item:nth-child(2n){
background-color: blue;
}
- flex-basis
- flex 박스의 너비를 일정한 크기로 나누어 갖는 방법
- 이것은 여백을 나누어 갖기 때문에 꼭 여백이 있어야 한다.
- 메인 축의 크기를 정하기 때문에 width와는 의미가 매우 다르다.
.flex-box{
background-color: gray;
display: flex;
flex-wrap : wrap;
}
.item{
color: white;
background-color: red;
}
.item:nth-child(2){
max-width: 30px;
}
.item:nth-child(5){
}
.item:nth-child(2n){
background-color: blue;
}
55강) Flex 아이템 크기
1) flex-shrink :
- 반응형으로 창의 크기를 늘리고 줄어들일 때, 해당 박스의 크기가 같이 줄어 들지 않는다.(‘0’로 설정할 경우)
- 이렇게 설정하면, 박스의 여백이 줄어드는 것일 뿐 콘텐츠의 크기가 줄어들지는 않는다.
- flex-shrink는 0, 1, 2, 3 이렇게 계속 설정할 수 있는데 flex-grow와 반대 개념으로 여백을 그 배수만큼 줄어들어 나눠서 비율을 차지한다.
.flex-box{
background-color: gray;
display: flex;
}
.item{
color: white;
background-color: red;
flex-basis: 100px;
}
.item:nth-child(1){
flex-basis: 100px; // 크기를 고정시키고 shrink를 '0'으로 설정하면
flex-shrink: 0; // 줄어들지 않는다.
}
.item:nth-child(5){
}
.item:nth-child(2n){
background-color: blue;
}
56강) Flex Lines 축약 표현, Ordering
1) flex lines 축약 표현
- 축약 표현
// 기본꼴
flex-grow: 0;
flsx-shrink: 0;
flex-basis: 100px;
// 축약 표현
flex: 0 0 100px;
- 축약 값
flex: none; // flex: 0 0 auto;
flex: auto; // flex: 1 1 auto;
flex: initial; // flex: 0 1 auto;
flex: 100px; // flex: 1 1 100px ;
- flex Lines 전체 실습 : Flex 박스 테스트
<div class="test-box">
<div class="header"> </div>
<div class="body">
<div class="aside"></div>
<div class="main"> </div>
</div>
<div class="footer"> </div>
</div>
.test-box{
display: flex;
flex-direction: column;
height: 500px;
}
.test-box .header{ // class에서 claas로 이동은 ' '(띄어쓰기)로 하부구조 구성
// 태그끼리 하부구조는 '>'로 하부구조 구성
background-color: green;
height: 50px;
}
.test-box .body{
background-color: black;
height: 300px;
flex-grow: 1;
display: flex; // 중요!! 부모에서 flex로 지정!
}
.test-box .aside{
background-color: aquablue;
width: 250px;
}
.test-box .main{
background-color: orange;
/* width: 250px; 이렇게 고정값으로 지정안하고 반응형으로 flex-grow 설정! */
flex-grow: 1;
}
.test-box .footer{
height: 50px;
background-color: gray;
flex-shrink: 0;
}
2) Ordering: flex
- 순서 바꾸기를 의미한다.
order : 1
나order : 2
로 인덱스를 설정해서 style 속성에 넣어서 컨텐츠 순서 변경이 가능하다.
- 실습 코드 :
.test-box{
display: flex;
flex-direction: column;
height: 500px;
}
.test-box .header{
background-color: green;
height: 50px;
}
.test-box .body{
background-color: black;
height: 300px;
flex-grow: 1;
display: flex; // 중요!! 부모에서 flex로 지정!
}
.test-box .aside{
background-color: aquablue;
width: 250px;
order: 2; // 이렇게 하면, 색깔 순서가 바뀐다.
}
.test-box .main{
background-color: orange;
/* width: 250px; 이렇게 고정값으로 지정안하고 반응형으로 flex-grow 설정! */
flex-grow: 1;
order: 1; // 이렇게 하면, 색깔 순서가 바뀐다.
}
.test-box .footer{
height: 50px;
background-color: gray;
flex-shrink: 0;
}
57강) Box Alignment 1(flex)
1) justify-content : 메인 축 정렬.
- flex-start : flex 박스의 시작 부분에 위치
- flex-end : flex 박스의 마지막 부분에 위치
- center : flex 박스의 중간 부분에 위치
- space-between : flex 박스의 양끝 부분에 위치
- space-around : flex 박스 내부의 아이템 좌우의 여백을 생성하고 위치 조정(그림을 보고 이해하자)
2) align-items : 크로스 축 정렬.
- 수직 방향에서는 여백이 없으므로 container에 높이를 꼭 설정해야만 한다.()
- 설정은 justify-content와 같다.
- flex.css
.flex-box{
background-color: gray;
height: 300px;
display: flex; // flex는 기본적으로 justify-content, align-items가 stretch이다.
// 아이템 전 영역을 차지함.
flex-wrap: wrap; // flex-wrap은 .item보다는 감싸야 하므로 .flex-box로 부모 박스에서 설정해줘야 한다.
align-items: center // 이렇게 하면, 각각 아이템의 영역을 유지한 상태에서 가운데 정렬을 한다. align-content와는 다르다.
}
.item{
color: white;
background-color: red;
/* flex-grow: 1; */
flex-basis: 100px;
flex-shrink: 1;
height: 50px; // 원래는 stretch 영역인데 값을 지정해주면 그 값만큼 아이템의 높이가 지정된다.
}
- flex.html
<body>
<hr>
<section>
<div class="flex-box">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
<div class="item">7</div>
<div class="item">8</div>
<div class="item">9</div>
<div class="item">10</div>
</div>
</section>
<hr>
</body>
3) align-self : 특정 아이템 속성 설정.
4) align-content : 패키징된 아이템들을 정렬.
- flex.css
.flex-box{
background-color: gray;
height: 300px;
display: flex; // flex는 기본적으로 justify-content, align-items가 stretch이다.
// 아이템 전 영역을 차지함.
flex-wrap: wrap; // flex-wrap은 .item보다는 감싸야 하므로 .flex-box로 부모 박스에서 설정해줘야 한다.
align-content: center;
// align-items와는 다르다. wrap에 의해서 아이템이 밀렸더라도 패키징으로 묶어서 하나의 덩어리로 인식하여 가운데 정렬한다.
// align-content: space-between; // align-content 설정에서 space-between을 해야지 우리가 원하는 결과가 나온다.
}
.item{
color: white;
background-color: red;
/* flex-grow: 1; */
flex-basis: 100px;
flex-shrink: 1;
height: 50px; // 원래는 stretch 영역인데 값을 지정해주면 그 값만큼 아이템의 높이가 지정된다.
}
5) basis와 width에서 우선순위는 basis가 이긴다.
.flex-box{
background-color: gray;
height: 300px;
display: flex;
flex-wrap: wrap;
align-content: center;
}
.item{
color: white;
background-color: red;
/* flex-grow: 1; */
/* flex-basis: 100px; */
flex-shrink: 1;
height: 50px;
}
.item:nth-child(1){
flex-basis: 100px;
width: 200px; // 200px은 먹힌다.
flex-shrink: 1;
height: 50px;
}
6) 컨테이너의 여백을 내가 원하는 곳에 넣기
- 특정위치에 여백을 몰아달라
- 어떤 특정 아이템 기준으로 왼쪽에 여백을 넣어달라고 하려면
margin-left: auto
으로 설정한다.
58강) header 스타일 주기
1) header에 마진 추가
- index.html
.header{
width: 100%;
height: 50px;
background-color: #0006;
/* layout */
position: fixed;
top: 0px;
z-index: 999; // 래이어 나누눈 부분!(뒷배경보다 위로 올리게!)
/* item layout */
display: flex; // 여기가 중요!!
align-items: center;
justify-content: space-between; // 중요!! 메인축 기준으로 양끝에 위치
padding : 0 15px; // 패딩을 줘야 여백을 줄 수 있어 디자인적으로 안정적이다.
box-sizing: border-box; // 하지만, padding을 이용할 경우에는 밀려서 border-box로 박스를 바꿔줘야한다.
// box-sizing: content-box;
}
/* =========== content block =========== */
.header-title{
display: inline-block;
font-family: "Segoe UI", "굴림", "돋움"
font-weight: normal;
font-size: 16px;
color: #fff;
font-stretch: ultra-expanded;
}
<header class="header" style="font-family: '굴림';">
<h1 class="header-title">알랜드</h1>
<div><a class="img-btn-menu" href="">메뉴버튼</a></div>
</header>
2) body의 cafe, top-menu 부분 마진 추가
- index.html
<nav class="cafe">
<h1 class="cafe-title">부안에 오면, ~ </h1>
<div class="cafe-menu-all"><a class="btn-cafe-menu-all" href="">전체 메뉴</a></div>
<nav class="top-menu d-inline-block">
<h1 class="d-none">인기 메뉴</h1>
<ul class="d-inline-block">
<li>
<img height="100" src="images/17.jpg" alt="딸기청">
<a target="_blank" href="menu/detail.html">딸기청</a>
</li>
<li>
<img height="100" src="images/17.jpg" alt="딸기청">
<a target="_blank" href="menu/detail.html">딸기청</a>
</li>
</ul>
</h1>
</nav>
</nav>
- index.css
.cafe{
padding-top: 50px;
height: 530px;
background: url("../images/cafe.png"),
-245px/cover #D4BFA0;
/* item layout */
display: flex; // 여기 추가!!
flex-direction: column;
}
.cafe-title{
margin-top: 23px;
margin-left: -14px;
}
.cafe-menu-all{
margin-top: auto;
align-self: flex-end;
margin-right: 5px;
}
.top-menu{
}
.top-menu > ul{
margin: 0;
padding: 0;
overflow: hidden; // 이걸 쓰면, 아까 클러킹한 배경을 숨겨 놓는다.
/* item layout */
display: flex;
}
.top-menu li{
/* float : left; */
list-style-type: none;
width : 100px;
height : 100px;
margin-left: 20px;
flex-shrink: 0; // 여기 추가!
}
.top-menu li.first{ // li 내부의 태그들 중 첫 번째 태그에 속성 추가!
margin-left: 24px;
}
.top-menu li>img{
width : 100%;
height : 100%;
object-fit: cover;
}
.top-menu li>a{
width : 100%;
height : 100%;
text-align: center;
display : flex;
align-items : center;
justify-content : center;
background-color: #0006; // 화면에서 안보이게 하는 방법 : 클러킹(박스 뒤에 배경)
color: #fff;
}