웹툰 홈 main-left 하단, main-right, footer, 웹툰 상세 main-left
남은 강의들을 8월 말까지 다 완료하기 위해 수강 스케줄을 새로 짰다.
github소스코드
padding: 26px 0 10px
패딩 값을 3개 줄 경우 상, 좌우, 하로 들어가게 된다.border
가 있고, 자식 태그에 hover 등으로 border를 추가할 때, margin-bottom: -1px;
처럼 음수값을 줘서 조절할 수 있다.background-image
로 채워넣고 default 인 repeat가 실행되도록 했다. 이미지를 가져올 때 현재 파일의 위치를 기준으로 경로 설정을 잘 해야 된다.#webtoon-main .webtoon-main-left .webtoon-content-info-right .webtoon-content-rating .star {
display: inline-block;
width: 80px;
height: 16px;
background-image: url(../../idus/img/star.png);
vertical-align: middle;
}
margin
등을 줘도 되겠지만 공간에 padding
값을 주고 사진 크기를 100%로 하면 padding 안의 영역에 사진이 가득 차게 된다.#webtoon-main .webtoon-main-right .webtoon-challenge-wrap {
width: 100%;
height: 255px;
background-color: #f9f9fc;
padding: 20px 18px;
}
#webtoon-main .webtoon-main-right .webtoon-challenge-wrap img {
width: 100%;
height: 110px;
margin-bottom: 18px;
}
<a>
태그로 만들어 주었다./* 웹툰 업로드 버튼 */
#webtoon-main .webtoon-main-right .btn-webtoon-upload {
display: inline-block;
width: 100%;
height: 42px;
background-color: #00d564;
margin-bottom: 8px;
text-align: center;
color: #fff;
line-height: 42px;
font-weight: 700;
}
border-color
로 안 보이게 색상만 바꿔주면 레이아웃 뒤틀림이 없다./* border 없애지말고 흰색으로 처리 */
#webtoon-main .webtoon-main-right .webtoon-popular .webtoon-popular-tabs .tab.active {
border-bottom: solid 1px #ffffff;
}
white-space: nowrap
줄바꿈 안함overflow: hidden
넘어가는 내용 자르기text-overflow: ellipsis
글자가 넘치는 경우 말줄임 표시하는 속성값.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
<ol>
태그를 사용한다. 기본적으로 앞에 숫자가 붙는데, 이 속성을 적용하려면 list-style:decimal
을 사용한다. decimal-leading-zero
도 있길래 써 보니 앞에 0을 추가해 01, 02, 03.. 이런 식으로 표시해준다.status
클래스로는 크기, status-stay
, status-up
, status-down
등 3가지 클래스로 색상을 변경해주었다. 나중에는 뒷 부분에 background-image
등을 적용하면 각기 다른 도형을 삽입할 수 있을 것 같다.<div class="status status-stay"></div>
<div class="status status-up"></div>
<div class="status status-down"></div>
#webtoon-main .webtoon-main-right .webtoon-popular .webtoon-popular-ranking li .rank-box .status {
width: 12px;
height: 12px;
}
#webtoon-main .webtoon-main-right .webtoon-popular .webtoon-popular-ranking li .rank-box .status.status-stay {
background-color: black;
}
#webtoon-main .webtoon-main-right .webtoon-popular .webtoon-popular-ranking li .rank-box .status.status-up {
background-color: red;
}
#webtoon-main .webtoon-main-right .webtoon-popular .webtoon-popular-ranking li .rank-box .status.status-down {
background-color: blue;
}
rank
클래스를 그대로 사용하면서도 다른 속성(위치조정)을 적용하기 위해 rank-custom
을 추가해서 사용했다.<span class="rank rank-custom">1</span>
/* 썸네일 이미지가 포함된 랭킹 */
#webtoon-main .webtoon-main-right .webtoon-popular .webtoon-popular-ranking .rank.rank-custom {
position: relative;
top: -10px;
}
<span>©naver corp</span>
text-transform: uppercase
: 태그의 글자를 전부 대문자로 바꾸어 주는 속성이다. lowercase
, capitalize
등 여러 효과들이 있다.#webtoon-footer .webtoon-container .webtoon-footer-wrap span {
text-transform: uppercase;
}
웹툰 상세 페이지는 main-left 영역을 제외하면 웹툰 홈과 같은 레이아웃을 사용하고 있었다.
position:relative
, 자식 태그에 position:absolute
를 주는 방법을 사용했다..webtoon-detail #webtoon-this-month .webtoon-monthly-list .monthly-img-wrap {
position: relative;
width: 100%;
height: 120px;
}
.webtoon-detail #webtoon-this-month .webtoon-monthly-list .monthly-img-wrap img {
position: absolute;
width: 100%;
height: 100%;
}
.webtoon-detail #webtoon-this-month .webtoon-monthly-list .monthly-img-wrap .new-mark {
position: absolute;
width: 30px;
}
align-item:stretch
속성을 적용했다..webtoon-detail #webtoon-daily .webtoon-day-lists {
display: flex;
align-items: stretch;
border-bottom: solid 1px #f4f4f4;
}
border-color
도 같이 신경써서 바꿔준다..webtoon-detail #webtoon-daily .webtoon-day-list.active {
background-color: #3a3a3a;
border-color: #3a3a3a;
color: #fdcb00;
}
<a>
태그의 속성이 내가 원하는 대로 지정되지 않고 cascading 순위에서 밀려나는 문제가 있었다. 둘다 마지막은 a로 선택하고 나중에 오는 코드가 더 자세하고 세부적인 것 같았는데 왜 먼저 오는 코드의 값이 적용되는지 잘 이해하지 못했다. 아직 내가 cascading 규칙을 잘 숙지하지 못한 것을 알게 되었다.오늘은 좀 욕심을 부린 것 같다. 내용이 많았다...ㅎㅎ 그래도 예전엔 코드를 하나하나 보고 따라 쳤다고 하면 요즘은 소리로만 들어도 대충 어느 태그에 어떤 속성을 적어야 할지 조금은 감이 온다. 강사님이 전에 말씀하신 대로 코드를 작성하면서 화면에 어떻게 나올지 미리 상상하는 연습이 도움이 된 것 같다.